From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- dom/canvas/CanvasRenderingContext2D.cpp | 95 +++- dom/canvas/ClientWebGLContext.cpp | 197 +++++--- dom/canvas/ClientWebGLContext.h | 34 +- dom/canvas/DrawTargetWebgl.cpp | 18 +- dom/canvas/DrawTargetWebgl.h | 2 + dom/canvas/HostWebGLContext.cpp | 11 + dom/canvas/HostWebGLContext.h | 2 - dom/canvas/PWebGL.ipdl | 4 +- dom/canvas/QueueParamTraits.h | 9 - dom/canvas/TexUnpackBlob.cpp | 2 + dom/canvas/TiedFields.h | 52 +- dom/canvas/WebGL2Context.h | 6 +- dom/canvas/WebGL2ContextState.cpp | 4 - dom/canvas/WebGL2ContextSync.cpp | 57 ++- dom/canvas/WebGLChild.cpp | 7 + dom/canvas/WebGLChild.h | 1 + dom/canvas/WebGLContext.cpp | 2 + dom/canvas/WebGLContext.h | 14 +- dom/canvas/WebGLContextState.cpp | 77 +-- dom/canvas/WebGLFramebuffer.cpp | 29 +- dom/canvas/WebGLIpdl.h | 72 +-- dom/canvas/WebGLParent.cpp | 9 - dom/canvas/WebGLParent.h | 1 - dom/canvas/WebGLSync.cpp | 35 +- dom/canvas/WebGLSync.h | 37 +- dom/canvas/WebGLTypes.h | 53 ++ dom/canvas/test/crossorigin/mochitest.toml | 4 + dom/canvas/test/mochitest.toml | 6 +- dom/canvas/test/test_imagebitmap.html | 4 +- dom/canvas/test/test_imagebitmap_cropping.html | 4 +- .../checkout/conformance/canvas/00_test_list.txt | 2 + .../canvas/drawingbuffer-storage-test.html | 27 + .../conformance/extensions/00_test_list.txt | 6 + .../conformance/extensions/ext-clip-control.html | 185 +++++++ .../conformance/extensions/ext-depth-clamp.html | 168 +++++++ .../extensions/ext-disjoint-timer-query.html | 59 +++ .../extensions/ext-polygon-offset-clamp.html | 172 +++++++ .../checkout/conformance/extensions/ext-sRGB.html | 34 ++ .../extensions/ext-texture-compression-rgtc.html | 8 +- .../ext-texture-mirror-clamp-to-edge.html | 217 ++++++++ .../extensions/khr-parallel-shader-compile.html | 26 + .../extensions/oes-texture-float-with-video.html | 1 - .../conformance/extensions/oes-texture-float.html | 65 +++ .../oes-texture-half-float-with-video.html | 1 - .../extensions/webgl-blend-func-extended.html | 26 + .../conformance/extensions/webgl-polygon-mode.html | 185 +++++++ .../conformance/reading/read-pixels-test.html | 37 ++ .../textures/misc/exif-orientation.html | 44 +- .../misc/tex-video-using-tex-unit-non-zero.html | 2 - .../textures/misc/texture-npot-video.html | 1 - .../textures/misc/texture-srgb-upload.html | 16 +- .../textures/misc/texture-upload-size.html | 1 - .../conformance/uniforms/uniform-location.html | 4 + .../checkout/conformance2/00_test_list.txt | 1 + .../checkout/conformance2/canvas/00_test_list.txt | 1 + .../canvas/drawingbuffer-storage-test.html | 27 + .../conformance2/extensions/00_test_list.txt | 11 + .../extensions/ext-conservative-depth.html | 145 ++++++ .../ext-disjoint-timer-query-webgl2.html | 58 +++ .../conformance2/extensions/ext-render-snorm.html | 201 ++++++++ .../nv-shader-noperspective-interpolation.html | 251 ++++++++++ .../extensions/oes-sample-variables.html | 474 ++++++++++++++++++ .../oes-shader-multisample-interpolation.html | 313 ++++++++++++ .../extensions/webgl-blend-func-extended.html | 26 + .../extensions/webgl-clip-cull-distance.html | 475 ++++++++++++++++++ .../extensions/webgl-provoking-vertex.html | 165 +++++++ .../extensions/webgl-render-shared-exponent.html | 251 ++++++++++ .../webgl-shader-pixel-local-storage.html | 445 +++++++++++++++++ .../extensions/webgl-stencil-texturing.html | 279 +++++++++++ .../checkout/conformance2/glsl3/00_test_list.txt | 1 + .../checkout/conformance2/glsl3/texture-bias.html | 146 ++++++ .../checkout/conformance2/query/00_test_list.txt | 1 + .../query/occlusion-query-scissor.html | 117 +++++ .../framebuffer-object-attachment.html | 112 ++++- .../renderbuffers/framebuffer-texture-layer.html | 31 ++ .../conformance2/rendering/00_test_list.txt | 1 - .../rendering/builtin-vert-attribs.html | 408 --------------- .../conformance2/textures/misc/00_test_list.txt | 1 + .../textures/misc/tex-image-10bpc.html | 66 +++ .../tex-image-with-bad-args-from-dom-elements.html | 1 - .../textures/misc/tex-new-formats.html | 30 ++ .../transform_feedback/simultaneous_binding.html | 11 + .../transform_feedback/transform_feedback.html | 66 +++ .../checkout/conformance2/wasm/00_test_list.txt | 12 + .../wasm/bufferdata-16gb-wasm-memory.html | 51 ++ .../wasm/bufferdata-4gb-wasm-memory.html | 51 ++ .../wasm/buffersubdata-16gb-wasm-memory.html | 52 ++ .../wasm/buffersubdata-4gb-wasm-memory.html | 52 ++ .../wasm/getbuffersubdata-16gb-wasm-memory.html | 48 ++ .../wasm/getbuffersubdata-4gb-wasm-memory.html | 48 ++ .../wasm/readpixels-16gb-wasm-memory.html | 51 ++ .../wasm/readpixels-4gb-wasm-memory.html | 50 ++ .../wasm/teximage2d-16gb-wasm-memory.html | 85 ++++ .../wasm/teximage2d-4gb-wasm-memory.html | 85 ++++ .../wasm/texsubimage2d-16gb-wasm-memory.html | 86 ++++ .../wasm/texsubimage2d-4gb-wasm-memory.html | 86 ++++ .../checkout/deqp/framework/common/tcuTestCase.js | 29 +- .../checkout/extra/tex-image-with-video-test.js | 1 - .../test/webgl-conf/checkout/js/js-test-pre.js | 21 +- .../checkout/js/tests/compressed-texture-utils.js | 6 +- .../js/tests/drawingbuffer-storage-test.js | 275 +++++++++++ .../js/tests/ext-color-buffer-half-float.js | 68 +++ ...nd-sub-image-2d-with-image-bitmap-from-video.js | 1 - .../tests/tex-image-and-sub-image-2d-with-video.js | 1 - ...nd-sub-image-3d-with-image-bitmap-from-video.js | 1 - .../tests/tex-image-and-sub-image-3d-with-video.js | 1 - .../checkout/js/tests/webgl-blend-func-extended.js | 548 +++++++++++++++++++++ .../webgl-conf/checkout/js/webgl-test-harness.js | 45 +- .../webgl-conf/checkout/py/lint/lint.allowlist | 3 +- .../exif-orientation-test-6-90-ccw.jpg | Bin 4841 -> 0 bytes .../exif-orientation-test-6-90-cw.jpg | Bin 0 -> 4840 bytes .../exif-orientation-test-8-90-ccw.jpg | Bin 0 -> 4841 bytes .../exif-orientation-test-8-90-cw.jpg | Bin 4840 -> 0 bytes .../resources/exif-orientation-test-6-90-ccw.jpg | Bin 4901 -> 0 bytes .../resources/exif-orientation-test-6-90-cw.jpg | Bin 0 -> 4901 bytes .../resources/exif-orientation-test-8-90-ccw.jpg | Bin 0 -> 4900 bytes .../resources/exif-orientation-test-8-90-cw.jpg | Bin 4900 -> 0 bytes .../checkout/resources/npot-video.theora.ogv | Bin 24630 -> 0 bytes .../resources/red-gradient-8x1-10bit-untagged.png | Bin 0 -> 90 bytes .../checkout/resources/red-green.theora.ogv | Bin 10292 -> 0 bytes .../test/webgl-conf/checkout/test-guidelines.md | 6 +- dom/canvas/test/webgl-conf/cherry_picks.txt | 59 +-- .../test/webgl-conf/generated-mochitest.toml | 182 ++++++- ...mance2__canvas__drawingbuffer-storage-test.html | 17 + ...mance2__extensions__ext-conservative-depth.html | 17 + ...conformance2__extensions__ext-render-snorm.html | 17 + ...ons__nv-shader-noperspective-interpolation.html | 17 + ...ormance2__extensions__oes-sample-variables.html | 17 + ...ions__oes-shader-multisample-interpolation.html | 17 + ...ce2__extensions__webgl-blend-func-extended.html | 17 + ...nce2__extensions__webgl-clip-cull-distance.html | 17 + ...mance2__extensions__webgl-provoking-vertex.html | 17 + ...__extensions__webgl-render-shared-exponent.html | 17 + ...tensions__webgl-shader-pixel-local-storage.html | 17 + ...ance2__extensions__webgl-stencil-texturing.html | 17 + .../test_2_conformance2__glsl3__texture-bias.html | 17 + ...nformance2__query__occlusion-query-scissor.html | 17 + ...formance2__rendering__builtin-vert-attribs.html | 17 - ...formance2__textures__misc__tex-image-10bpc.html | 17 + ...rmance2__wasm__bufferdata-16gb-wasm-memory.html | 17 + ...ormance2__wasm__bufferdata-4gb-wasm-memory.html | 17 + ...nce2__wasm__buffersubdata-16gb-wasm-memory.html | 17 + ...ance2__wasm__buffersubdata-4gb-wasm-memory.html | 17 + ...2__wasm__getbuffersubdata-16gb-wasm-memory.html | 17 + ...e2__wasm__getbuffersubdata-4gb-wasm-memory.html | 17 + ...rmance2__wasm__readpixels-16gb-wasm-memory.html | 17 + ...ormance2__wasm__readpixels-4gb-wasm-memory.html | 17 + ...rmance2__wasm__teximage2d-16gb-wasm-memory.html | 17 + ...ormance2__wasm__teximage2d-4gb-wasm-memory.html | 17 + ...nce2__wasm__texsubimage2d-16gb-wasm-memory.html | 17 + ...ance2__wasm__texsubimage2d-4gb-wasm-memory.html | 17 + ..._conformance__extensions__ext-clip-control.html | 17 + ...2_conformance__extensions__ext-depth-clamp.html | 17 + ...ance__extensions__ext-polygon-offset-clamp.html | 17 + ...tensions__ext-texture-mirror-clamp-to-edge.html | 17 + ...onformance__extensions__webgl-polygon-mode.html | 17 + ..._conformance__extensions__ext-clip-control.html | 17 + ...t_conformance__extensions__ext-depth-clamp.html | 17 + ...ance__extensions__ext-polygon-offset-clamp.html | 17 + ...tensions__ext-texture-mirror-clamp-to-edge.html | 17 + ...nce__extensions__webgl-blend-func-extended.html | 17 + ...onformance__extensions__webgl-polygon-mode.html | 17 + dom/canvas/test/webgl-conf/mochitest-errata.toml | 62 +++ dom/canvas/test/webgl-conf/moz.yaml | 4 +- dom/canvas/test/webgl-mochitest/mochitest.toml | 13 +- .../test/webgl-mochitest/red-green.theora.ogv | Bin 10292 -> 0 bytes .../test_video_fastpath_theora.html | 21 - 167 files changed, 8147 insertions(+), 870 deletions(-) create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-storage-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-clip-control.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-depth-clamp.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-polygon-offset-clamp.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-mirror-clamp-to-edge.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-blend-func-extended.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-polygon-mode.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/canvas/drawingbuffer-storage-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-conservative-depth.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-render-snorm.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/nv-shader-noperspective-interpolation.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/oes-sample-variables.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/oes-shader-multisample-interpolation.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-blend-func-extended.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-clip-cull-distance.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-provoking-vertex.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-render-shared-exponent.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-shader-pixel-local-storage.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-stencil-texturing.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-bias.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/query/occlusion-query-scissor.html delete mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/rendering/builtin-vert-attribs.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-10bpc.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/00_test_list.txt create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/bufferdata-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/bufferdata-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/buffersubdata-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/buffersubdata-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/getbuffersubdata-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/readpixels-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/readpixels-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/teximage2d-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/teximage2d-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/conformance2/wasm/texsubimage2d-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/drawingbuffer-storage-test.js create mode 100644 dom/canvas/test/webgl-conf/checkout/js/tests/webgl-blend-func-extended.js delete mode 100644 dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-6-90-ccw.jpg create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-6-90-cw.jpg create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-8-90-ccw.jpg delete mode 100644 dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-8-90-cw.jpg delete mode 100644 dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-6-90-ccw.jpg create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-6-90-cw.jpg create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-8-90-ccw.jpg delete mode 100644 dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-8-90-cw.jpg delete mode 100644 dom/canvas/test/webgl-conf/checkout/resources/npot-video.theora.ogv create mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-gradient-8x1-10bit-untagged.png delete mode 100644 dom/canvas/test/webgl-conf/checkout/resources/red-green.theora.ogv create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__canvas__drawingbuffer-storage-test.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-conservative-depth.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-render-snorm.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__nv-shader-noperspective-interpolation.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__oes-sample-variables.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__oes-shader-multisample-interpolation.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-blend-func-extended.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-clip-cull-distance.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-provoking-vertex.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-render-shared-exponent.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-shader-pixel-local-storage.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-stencil-texturing.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__texture-bias.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__query__occlusion-query-scissor.html delete mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__builtin-vert-attribs.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-10bpc.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__bufferdata-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__bufferdata-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__buffersubdata-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__buffersubdata-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__getbuffersubdata-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__getbuffersubdata-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__readpixels-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__readpixels-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__teximage2d-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__teximage2d-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__texsubimage2d-16gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__texsubimage2d-4gb-wasm-memory.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-clip-control.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-depth-clamp.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-polygon-offset-clamp.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-texture-mirror-clamp-to-edge.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-polygon-mode.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-clip-control.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-depth-clamp.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-polygon-offset-clamp.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-texture-mirror-clamp-to-edge.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-blend-func-extended.html create mode 100644 dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-polygon-mode.html delete mode 100644 dom/canvas/test/webgl-mochitest/red-green.theora.ogv delete mode 100644 dom/canvas/test/webgl-mochitest/test_video_fastpath_theora.html (limited to 'dom/canvas') diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 62f6e6443d..1a79a9f734 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -682,6 +682,8 @@ class AdjustedTarget { CompositionOp UsedOperation() const { return mUsedOperation; } + bool UseOptimizeShadow() const { return mOptimizeShadow; } + ShadowOptions ShadowParams() const { const ContextState& state = mCtx->CurrentState(); return ShadowOptions(ToDeviceColor(state.shadowColor), state.shadowOffset, @@ -5359,6 +5361,40 @@ static Matrix ComputeRotationMatrix(gfxFloat aRotatedWidth, .PostTranslate(shiftLeftTopToOrigin); } +static Maybe +MaybeGetSurfaceDescriptorForRemoteCanvas( + const SurfaceFromElementResult& aResult) { + if (!StaticPrefs::gfx_canvas_remote_use_draw_image_fast_path()) { + return Nothing(); + } + + if (!aResult.mLayersImage) { + return Nothing(); + } + + Maybe sd; + sd = aResult.mLayersImage->GetDesc(); + if (sd.isNothing() || + sd.ref().type() != + layers::SurfaceDescriptor::TSurfaceDescriptorGPUVideo) { + return Nothing(); + } + + const auto& sdv = sd.ref().get_SurfaceDescriptorGPUVideo(); + const auto& sdvType = sdv.type(); + if (sdvType == + layers::SurfaceDescriptorGPUVideo::TSurfaceDescriptorRemoteDecoder) { + const auto& sdrd = sdv.get_SurfaceDescriptorRemoteDecoder(); + const auto& subdesc = sdrd.subdesc(); + const auto& subdescType = subdesc.type(); + if (subdescType == layers::RemoteDecoderVideoSubDescriptor::Tnull_t) { + return sd; + } + } + + return Nothing(); +} + // 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, @@ -5470,6 +5506,8 @@ void CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage, } DirectDrawInfo drawInfo; + Maybe surfaceDescriptor; + SurfaceFromElementResult res; if (!srcSurf) { // The canvas spec says that drawImage should draw the first frame @@ -5478,7 +5516,6 @@ void CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage, nsLayoutUtils::SFE_NO_RASTERIZING_VECTORS | nsLayoutUtils::SFE_ALLOW_UNCROPPED_UNSCALED; - SurfaceFromElementResult res; if (offscreenCanvas) { res = nsLayoutUtils::SurfaceFromOffscreenCanvas(offscreenCanvas, sfeFlags, mTarget); @@ -5487,12 +5524,34 @@ void CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage, } else { res = CanvasRenderingContext2D::CachedSurfaceFromElement(element); if (!res.mSourceSurface) { - res = nsLayoutUtils::SurfaceFromElement(element, sfeFlags, mTarget); + HTMLVideoElement* video = HTMLVideoElement::FromNodeOrNull(element); + if (video && mBufferProvider->IsAccelerated() && + mTarget->IsRecording() && + !(!NeedToApplyFilter() && NeedToDrawShadow())) { + res = nsLayoutUtils::SurfaceFromElement( + video, sfeFlags, mTarget, /* aOptimizeSourceSurface */ false); + surfaceDescriptor = MaybeGetSurfaceDescriptorForRemoteCanvas(res); + if (surfaceDescriptor.isNothing() && res.mLayersImage) { + if ((res.mSourceSurface = res.mLayersImage->GetAsSourceSurface())) { + RefPtr opt = + mTarget->OptimizeSourceSurface(res.mSourceSurface); + if (opt) { + res.mSourceSurface = opt; + } + } + } + } else { + res = nsLayoutUtils::SurfaceFromElement(element, sfeFlags, mTarget); + } } } - srcSurf = res.GetSourceSurface(); - if (!srcSurf && !res.mDrawInfo.mImgContainer) { + if (surfaceDescriptor.isNothing()) { + srcSurf = res.GetSourceSurface(); + } + + if (!srcSurf && surfaceDescriptor.isNothing() && + !res.mDrawInfo.mImgContainer) { // https://html.spec.whatwg.org/#check-the-usability-of-the-image-argument: // // Only throw if the request is broken and the element is an @@ -5612,10 +5671,10 @@ void CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage, return; } - if (srcSurf) { + if (srcSurf || surfaceDescriptor.isSome()) { gfx::Rect sourceRect(aSx, aSy, aSw, aSh); - if ((element && element == mCanvasElement) || - (offscreenCanvas && offscreenCanvas == mOffscreenCanvas)) { + if (srcSurf && ((element && element == mCanvasElement) || + (offscreenCanvas && offscreenCanvas == mOffscreenCanvas))) { // 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. @@ -5656,10 +5715,24 @@ void CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage, destRect.y = 0; } - tempTarget.DrawSurface( - srcSurf, destRect, sourceRect, - DrawSurfaceOptions(samplingFilter, SamplingBounds::UNBOUNDED), - DrawOptions(CurrentState().globalAlpha, op, antialiasMode)); + if (srcSurf) { + MOZ_ASSERT(surfaceDescriptor.isNothing()); + + tempTarget.DrawSurface( + srcSurf, destRect, sourceRect, + DrawSurfaceOptions(samplingFilter, SamplingBounds::UNBOUNDED), + DrawOptions(CurrentState().globalAlpha, op, antialiasMode)); + } else if (surfaceDescriptor.isSome()) { + MOZ_ASSERT(!tempTarget.UseOptimizeShadow()); + MOZ_ASSERT(res.mLayersImage); + + mTarget->DrawSurfaceDescriptor( + surfaceDescriptor.ref(), res.mLayersImage, destRect, sourceRect, + DrawSurfaceOptions(samplingFilter, SamplingBounds::UNBOUNDED), + DrawOptions(CurrentState().globalAlpha, op, antialiasMode)); + } else { + MOZ_ASSERT_UNREACHABLE("unexpected to be called"); + } if (rotationDeg != VideoRotation::kDegree_0) { tempTarget->SetTransform(currentTransform); diff --git a/dom/canvas/ClientWebGLContext.cpp b/dom/canvas/ClientWebGLContext.cpp index 1614d2ead2..236ea916d0 100644 --- a/dom/canvas/ClientWebGLContext.cpp +++ b/dom/canvas/ClientWebGLContext.cpp @@ -548,36 +548,42 @@ Maybe ClientWebGLContext::GetFrontBuffer( const auto& child = mNotLost->outOfProcess; child->FlushPendingCmds(); - Maybe ret; + // Always synchronously get the front buffer if not using a remote texture. + bool needsSync = true; + Maybe syncDesc; + Maybe remoteDesc; auto& info = child->GetFlushedCmdInfo(); // If valid remote texture data was set for async present, then use it. if (!fb && !vr && mRemoteTextureOwnerId && mLastRemoteTextureId) { const auto tooManyFlushes = 10; // If there are many flushed cmds, force synchronous IPC to avoid too many - // pending ipc messages. - if (XRE_IsParentProcess() || - gfx::gfxVars::WebglOopAsyncPresentForceSync() || - info.flushesSinceLastCongestionCheck > tooManyFlushes) { - // Request the front buffer from IPDL to cause a sync, even though we - // will continue to use the remote texture descriptor after. - (void)child->SendGetFrontBuffer(fb ? fb->mId : 0, vr, &ret); - } - // Reset flushesSinceLastCongestionCheck - info.flushesSinceLastCongestionCheck = 0; - info.congestionCheckGeneration++; + // pending ipc messages. Otherwise don't sync for other cases to avoid any + // performance penalty. + needsSync = XRE_IsParentProcess() || + gfx::gfxVars::WebglOopAsyncPresentForceSync() || + info.flushesSinceLastCongestionCheck > tooManyFlushes; - return Some(layers::SurfaceDescriptorRemoteTexture(*mLastRemoteTextureId, - *mRemoteTextureOwnerId)); + // Only send over a remote texture descriptor if the WebGLChild actor is + // alive to ensure the remote texture id is valid. + if (child->CanSend()) { + remoteDesc = Some(layers::SurfaceDescriptorRemoteTexture( + *mLastRemoteTextureId, *mRemoteTextureOwnerId)); + } } - if (!child->SendGetFrontBuffer(fb ? fb->mId : 0, vr, &ret)) return {}; + if (needsSync && + !child->SendGetFrontBuffer(fb ? fb->mId : 0, vr, &syncDesc)) { + return {}; + } // Reset flushesSinceLastCongestionCheck info.flushesSinceLastCongestionCheck = 0; info.congestionCheckGeneration++; - return ret; + // If there is a remote texture descriptor, use that preferentially, as the + // sync front buffer descriptor was only created to force a sync first. + return remoteDesc ? remoteDesc : syncDesc; } Maybe ClientWebGLContext::PresentFrontBuffer( @@ -957,9 +963,31 @@ bool ClientWebGLContext::CreateHostContext(const uvec2& requestedSize) { .mCurrentQueryByTarget[LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN]; } + state.mIsEnabledMap = Some(webgl::MakeIsEnabledMap(mIsWebGL2)); + return true; } +std::unordered_map webgl::MakeIsEnabledMap(const bool webgl2) { + auto ret = std::unordered_map{}; + + ret[LOCAL_GL_BLEND] = false; + ret[LOCAL_GL_CULL_FACE] = false; + ret[LOCAL_GL_DEPTH_TEST] = false; + ret[LOCAL_GL_DITHER] = true; + ret[LOCAL_GL_POLYGON_OFFSET_FILL] = false; + ret[LOCAL_GL_SAMPLE_ALPHA_TO_COVERAGE] = false; + ret[LOCAL_GL_SAMPLE_COVERAGE] = false; + ret[LOCAL_GL_SCISSOR_TEST] = false; + ret[LOCAL_GL_STENCIL_TEST] = false; + + if (webgl2) { + ret[LOCAL_GL_RASTERIZER_DISCARD] = false; + } + + return ret; +} + // ------- uvec2 ClientWebGLContext::DrawingBufferSize() { @@ -1461,6 +1489,8 @@ already_AddRefed ClientWebGLContext::FenceSync( availRunnable.mSyncs.push_back(ret.get()); ret->mCanBeAvailable = false; + AutoEnqueueFlush(); + return ret.forget(); } @@ -1895,24 +1925,40 @@ bool ClientWebGLContext::IsVertexArray( // ------------------------- GL State ------------------------- -void ClientWebGLContext::SetEnabledI(GLenum cap, Maybe i, - bool val) const { +void ClientWebGLContext::SetEnabledI(const GLenum cap, const Maybe i, + const bool val) const { + const FuncScope funcScope(*this, "enable/disable"); + if (IsContextLost()) return; + + auto& map = *mNotLost->state.mIsEnabledMap; + auto slot = MaybeFind(map, cap); + if (i && cap != LOCAL_GL_BLEND) { + slot = nullptr; + } + if (!slot) { + EnqueueError_ArgEnum("cap", cap); + return; + } + Run(cap, i, val); + + if (!i || *i == 0) { + *slot = val; + } } -bool ClientWebGLContext::IsEnabled(GLenum cap) const { +bool ClientWebGLContext::IsEnabled(const GLenum cap) const { const FuncScope funcScope(*this, "isEnabled"); if (IsContextLost()) return false; - const auto& inProcess = mNotLost->inProcess; - if (inProcess) { - return inProcess->IsEnabled(cap); + const auto& map = *mNotLost->state.mIsEnabledMap; + const auto slot = MaybeFind(map, cap); + if (!slot) { + EnqueueError_ArgEnum("cap", cap); + return false; } - const auto& child = mNotLost->outOfProcess; - child->FlushPendingCmds(); - bool ret = {}; - if (!child->SendIsEnabled(cap, &ret)) return false; - return ret; + + return *slot; } template @@ -2178,6 +2224,10 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, (void)ToJSValueOrNull(cx, state.mBoundDrawFb, retval); return; + case LOCAL_GL_MAX_CLIENT_WAIT_TIMEOUT_WEBGL: + retval.set(JS::NumberValue(webgl::kMaxClientWaitSyncTimeoutNS)); + return; + case LOCAL_GL_PIXEL_PACK_BUFFER_BINDING: fnSetRetval_Buffer(LOCAL_GL_PIXEL_PACK_BUFFER); return; @@ -2987,7 +3037,7 @@ void ClientWebGLContext::DepthRange(GLclampf zNear, GLclampf zFar) { Run(zNear, zFar); } -void ClientWebGLContext::Flush(const bool flushGl) { +void ClientWebGLContext::Flush(const bool flushGl) const { const FuncScope funcScope(*this, "flush"); if (IsContextLost()) return; @@ -5417,13 +5467,11 @@ void ClientWebGLContext::GetSyncParameter( case LOCAL_GL_SYNC_FLAGS: return JS::NumberValue(0); case LOCAL_GL_SYNC_STATUS: { - if (!sync.mSignaled) { - const auto res = ClientWaitSync(sync, 0, 0); - sync.mSignaled = (res == LOCAL_GL_ALREADY_SIGNALED || - res == LOCAL_GL_CONDITION_SATISFIED); - } - return JS::NumberValue(sync.mSignaled ? LOCAL_GL_SIGNALED - : LOCAL_GL_UNSIGNALED); + const auto res = ClientWaitSync(sync, 0, 0); + const auto signaled = (res == LOCAL_GL_ALREADY_SIGNALED || + res == LOCAL_GL_CONDITION_SATISFIED); + return JS::NumberValue(signaled ? LOCAL_GL_SIGNALED + : LOCAL_GL_UNSIGNALED); } default: EnqueueError_ArgEnum("pname", pname); @@ -5432,6 +5480,8 @@ void ClientWebGLContext::GetSyncParameter( }()); } +// - + GLenum ClientWebGLContext::ClientWaitSync(WebGLSyncJS& sync, const GLbitfield flags, const GLuint64 timeout) const { @@ -5439,12 +5489,63 @@ GLenum ClientWebGLContext::ClientWaitSync(WebGLSyncJS& sync, if (IsContextLost()) return LOCAL_GL_WAIT_FAILED; if (!sync.ValidateUsable(*this, "sync")) return LOCAL_GL_WAIT_FAILED; - if (flags != 0 && flags != LOCAL_GL_SYNC_FLUSH_COMMANDS_BIT) { + static constexpr auto VALID_BITS = LOCAL_GL_SYNC_FLUSH_COMMANDS_BIT; + if ((flags | VALID_BITS) != VALID_BITS) { EnqueueError(LOCAL_GL_INVALID_VALUE, "`flags` must be SYNC_FLUSH_COMMANDS_BIT or 0."); return LOCAL_GL_WAIT_FAILED; } + if (timeout > webgl::kMaxClientWaitSyncTimeoutNS) { + EnqueueError( + LOCAL_GL_INVALID_OPERATION, + "`timeout` (%sns) must be less than MAX_CLIENT_WAIT_TIMEOUT_WEBGL " + "(%sns).", + ToStringWithCommas(timeout).c_str(), + ToStringWithCommas(webgl::kMaxClientWaitSyncTimeoutNS).c_str()); + return LOCAL_GL_WAIT_FAILED; + } + + const bool canBeAvailable = + (sync.mCanBeAvailable || StaticPrefs::webgl_allow_immediate_queries()); + if (!canBeAvailable) { + constexpr uint8_t WARN_AT = 100; + if (sync.mNumQueriesBeforeFirstFrameBoundary <= WARN_AT) { + sync.mNumQueriesBeforeFirstFrameBoundary += 1; + if (sync.mNumQueriesBeforeFirstFrameBoundary == WARN_AT) { + EnqueueWarning( + "ClientWaitSync must return TIMEOUT_EXPIRED until control has" + " returned to the user agent's main loop, but was polled %hhu " + "times. Are you spin-locking? (only warns once)", + sync.mNumQueriesBeforeFirstFrameBoundary); + } + } + return LOCAL_GL_TIMEOUT_EXPIRED; + } + + if (mCompletedSyncId >= sync.mId) { + return LOCAL_GL_ALREADY_SIGNALED; + } + if (flags & LOCAL_GL_SYNC_FLUSH_COMMANDS_BIT) { + Flush(); + } else { + constexpr uint8_t WARN_AT = 100; + if (sync.mNumQueriesWithoutFlushCommandsBit <= WARN_AT) { + sync.mNumQueriesWithoutFlushCommandsBit += 1; + if (sync.mNumQueriesWithoutFlushCommandsBit == WARN_AT) { + EnqueueWarning( + "ClientWaitSync with timeout=0 (or GetSyncParameter(SYNC_STATUS)) " + "called %hhu times without SYNC_FLUSH_COMMANDS_BIT. If you do not " + "flush, this sync object is not guaranteed to ever complete.", + sync.mNumQueriesWithoutFlushCommandsBit); + } + } + } + if (!timeout) return LOCAL_GL_TIMEOUT_EXPIRED; + + // - + // Fine, time to block: + const auto ret = [&]() { const auto& inProcess = mNotLost->inProcess; if (inProcess) { @@ -5462,29 +5563,10 @@ GLenum ClientWebGLContext::ClientWaitSync(WebGLSyncJS& sync, switch (ret) { case LOCAL_GL_CONDITION_SATISFIED: case LOCAL_GL_ALREADY_SIGNALED: - sync.mSignaled = true; + OnSyncComplete(sync.mId); break; } - // - - - const bool canBeAvailable = - (sync.mCanBeAvailable || StaticPrefs::webgl_allow_immediate_queries()); - if (!canBeAvailable) { - constexpr uint8_t WARN_AT = 100; - if (sync.mNumQueriesBeforeFirstFrameBoundary <= WARN_AT) { - sync.mNumQueriesBeforeFirstFrameBoundary += 1; - if (sync.mNumQueriesBeforeFirstFrameBoundary == WARN_AT) { - EnqueueWarning( - "ClientWaitSync must return TIMEOUT_EXPIRED until control has" - " returned to the user agent's main loop, but was polled %hhu " - "times. Are you spin-locking? (only warns once)", - sync.mNumQueriesBeforeFirstFrameBoundary); - } - } - return LOCAL_GL_TIMEOUT_EXPIRED; - } - return ret; } @@ -5688,6 +5770,7 @@ void ClientWebGLContext::DrawBuffers(const dom::Sequence& buffers) { void ClientWebGLContext::EnqueueErrorImpl(const GLenum error, const nsACString& text) const { if (!mNotLost) return; // Ignored if context is lost. + AutoEnqueueFlush(); Run(error, ToString(text)); } @@ -6570,7 +6653,7 @@ Maybe> ClientWebGLContext::ValidateArrayBufferView( // --------------------------- webgl::ObjectJS::ObjectJS(const ClientWebGLContext& webgl) - : mGeneration(webgl.mNotLost), mId(webgl.mNotLost->state.NextId()) {} + : mGeneration(webgl.mNotLost), mId(webgl.NextId()) {} // - diff --git a/dom/canvas/ClientWebGLContext.h b/dom/canvas/ClientWebGLContext.h index 3c011a3027..e736235361 100644 --- a/dom/canvas/ClientWebGLContext.h +++ b/dom/canvas/ClientWebGLContext.h @@ -134,9 +134,6 @@ class ShaderKeepAlive final { }; class ContextGenerationInfo final { - private: - ObjectId mLastId = 0; - public: webgl::ExtensionBits mEnabledExtensions; RefPtr mCurrentProgram; @@ -180,7 +177,7 @@ class ContextGenerationInfo final { webgl::ProvokingVertex mProvokingVertex = webgl::ProvokingVertex::LastVertex; - ObjectId NextId() { return mLastId += 1; } + mutable Maybe> mIsEnabledMap; }; // - @@ -493,7 +490,7 @@ class WebGLSyncJS final : public nsWrapperCache, bool mCanBeAvailable = false; uint8_t mNumQueriesBeforeFirstFrameBoundary = 0; - bool mSignaled = false; + uint8_t mNumQueriesWithoutFlushCommandsBit = 0; public: NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLSyncJS) @@ -781,8 +778,11 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal, mutable GLenum mNextError = 0; mutable webgl::LossStatus mLossStatus = webgl::LossStatus::Ready; mutable bool mAwaitingRestore = false; + mutable webgl::ObjectId mLastId = 0; public: + webgl::ObjectId NextId() const { return mLastId += 1; } + // Holds Some Id if async present is used mutable Maybe mLastRemoteTextureId; mutable Maybe mRemoteTextureOwnerId; @@ -1092,15 +1092,15 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal, // - - bool mAutoFlushPending = false; + mutable bool mAutoFlushPending = false; - void AutoEnqueueFlush() { + void AutoEnqueueFlush() const { if (MOZ_LIKELY(mAutoFlushPending)) return; mAutoFlushPending = true; - const auto weak = WeakPtr(this); - const auto DeferredFlush = [weak]() { - const auto strong = RefPtr(weak); + const auto DeferredFlush = [weak = + WeakPtr(this)]() { + const auto strong = RefPtr(weak); if (!strong) return; if (!strong->mAutoFlushPending) return; strong->mAutoFlushPending = false; @@ -1111,12 +1111,12 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal, }; already_AddRefed runnable = - NS_NewCancelableRunnableFunction("enqueue Event_webglcontextrestored", + NS_NewCancelableRunnableFunction("ClientWebGLContext::DeferredFlush", DeferredFlush); NS_DispatchToCurrentThread(std::move(runnable)); } - void CancelAutoFlush() { mAutoFlushPending = false; } + void CancelAutoFlush() const { mAutoFlushPending = false; } // - @@ -1141,6 +1141,7 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal, void Disable(GLenum cap) const { SetEnabledI(cap, {}, false); } void Enable(GLenum cap) const { SetEnabledI(cap, {}, true); } void SetEnabledI(GLenum cap, Maybe i, bool val) const; + bool IsEnabled(GLenum cap) const; private: @@ -1397,7 +1398,7 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal, void DepthRange(GLclampf zNear, GLclampf zFar); - void Flush(bool flushGl = true); + void Flush(bool flushGl = true) const; void Finish(); @@ -2245,6 +2246,13 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal, JS::MutableHandle retval) const; void WaitSync(const WebGLSyncJS&, GLbitfield flags, GLint64 timeout) const; + mutable webgl::ObjectId mCompletedSyncId = 0; + void OnSyncComplete(webgl::ObjectId id) const { + if (mCompletedSyncId < id) { + mCompletedSyncId = id; + } + } + // -------------------------- Transform Feedback --------------------------- void BindTransformFeedback(GLenum target, WebGLTransformFeedbackJS*); diff --git a/dom/canvas/DrawTargetWebgl.cpp b/dom/canvas/DrawTargetWebgl.cpp index eae6dd78f3..fdc45cc842 100644 --- a/dom/canvas/DrawTargetWebgl.cpp +++ b/dom/canvas/DrawTargetWebgl.cpp @@ -21,6 +21,7 @@ #include "mozilla/gfx/Swizzle.h" #include "mozilla/layers/ImageDataSerializer.h" #include "mozilla/layers/RemoteTextureMap.h" +#include "mozilla/widget/ScreenManager.h" #include "skia/include/core/SkPixmap.h" #include "nsContentUtils.h" @@ -325,6 +326,11 @@ void SharedContextWebgl::UnlinkGlyphCaches() { void SharedContextWebgl::OnMemoryPressure() { mShouldClearCaches = true; } +void SharedContextWebgl::ClearCaches() { + OnMemoryPressure(); + ClearCachesIfNecessary(); +} + // Clear out the entire list of texture handles from any source. void SharedContextWebgl::ClearAllTextures() { while (!mTextureHandles.isEmpty()) { @@ -852,10 +858,14 @@ bool DrawTargetWebgl::CanCreate(const IntSize& aSize, SurfaceFormat aFormat) { // In addition, allow acceleration up to this size even if the screen is // smaller. A lot content expects this size to work well. See Bug 999841 static const int32_t kScreenPixels = 980 * 480; - IntSize screenSize = gfxPlatform::GetPlatform()->GetScreenSize(); - if (aSize.width * aSize.height > - std::max(screenSize.width * screenSize.height, kScreenPixels)) { - return false; + + if (RefPtr screen = + widget::ScreenManager::GetSingleton().GetPrimaryScreen()) { + LayoutDeviceIntSize screenSize = screen->GetRect().Size(); + if (aSize.width * aSize.height > + std::max(screenSize.width * screenSize.height, kScreenPixels)) { + return false; + } } } diff --git a/dom/canvas/DrawTargetWebgl.h b/dom/canvas/DrawTargetWebgl.h index 955ccaabf0..8dc9fff048 100644 --- a/dom/canvas/DrawTargetWebgl.h +++ b/dom/canvas/DrawTargetWebgl.h @@ -92,6 +92,8 @@ class SharedContextWebgl : public mozilla::RefCounted, void OnMemoryPressure(); + void ClearCaches(); + private: SharedContextWebgl(); diff --git a/dom/canvas/HostWebGLContext.cpp b/dom/canvas/HostWebGLContext.cpp index 11051c756f..4eea15773a 100644 --- a/dom/canvas/HostWebGLContext.cpp +++ b/dom/canvas/HostWebGLContext.cpp @@ -180,6 +180,17 @@ void HostWebGLContext::CreateSync(const ObjectId id) { return; } slot = GetWebGL2Context()->FenceSync(LOCAL_GL_SYNC_GPU_COMMANDS_COMPLETE, 0); + + if (!slot) return; + + slot->OnCompleteTaskAdd([host = WeakPtr{this}, id]() { + if (!host) return; + if (host->mOwnerData.inProcess) { + host->mOwnerData.inProcess->OnSyncComplete(id); + } else if (host->mOwnerData.outOfProcess) { + (void)host->mOwnerData.outOfProcess->SendOnSyncComplete(id); + } + }); } void HostWebGLContext::CreateTexture(const ObjectId id) { diff --git a/dom/canvas/HostWebGLContext.h b/dom/canvas/HostWebGLContext.h index cc385bc26a..23b836f9db 100644 --- a/dom/canvas/HostWebGLContext.h +++ b/dom/canvas/HostWebGLContext.h @@ -260,8 +260,6 @@ class HostWebGLContext final : public SupportsWeakPtr { mContext->SetEnabled(cap, i, val); } - bool IsEnabled(GLenum cap) const { return mContext->IsEnabled(cap); } - Maybe GetNumber(GLenum pname) const { return mContext->GetParameter(pname); } diff --git a/dom/canvas/PWebGL.ipdl b/dom/canvas/PWebGL.ipdl index a49d41e582..82c813bfd5 100644 --- a/dom/canvas/PWebGL.ipdl +++ b/dom/canvas/PWebGL.ipdl @@ -101,7 +101,6 @@ parent: sync GetTexParameter(uint64_t id, uint32_t pname) returns (double? ret); sync GetUniform(uint64_t id, uint32_t loc) returns (GetUniformData ret); sync GetVertexAttrib(uint32_t index, uint32_t pname) returns (double? ret); - sync IsEnabled(uint32_t cap) returns (bool ret); sync OnMemoryPressure(); sync ValidateProgram(uint64_t id) returns (bool ret); @@ -110,6 +109,9 @@ child: // Tell client that this queue needs to be shut down async OnContextLoss(ContextLossReason aReason); + + // Triggered when the id from FenceSync completes. + async OnSyncComplete(uint64_t id); }; } // dom diff --git a/dom/canvas/QueueParamTraits.h b/dom/canvas/QueueParamTraits.h index a67f5abf51..87fe910675 100644 --- a/dom/canvas/QueueParamTraits.h +++ b/dom/canvas/QueueParamTraits.h @@ -261,15 +261,6 @@ struct QueueParamTraits { // --------------------------------------------------------------- -template -Maybe AsValidEnum(const std::underlying_type_t raw_val) { - const auto raw_enum = T{raw_val}; // This is the risk we prevent! - if (!IsEnumCase(raw_enum)) return {}; - return Some(raw_enum); -} - -// - - template struct QueueParamTraits_IsEnumCase { template diff --git a/dom/canvas/TexUnpackBlob.cpp b/dom/canvas/TexUnpackBlob.cpp index e13dc1c064..c59253cfd8 100644 --- a/dom/canvas/TexUnpackBlob.cpp +++ b/dom/canvas/TexUnpackBlob.cpp @@ -25,6 +25,8 @@ namespace mozilla { bool webgl::PixelPackingState::AssertCurrentUnpack(gl::GLContext& gl, const bool isWebgl2) const { + if (!kIsDebug) return true; + auto actual = PixelPackingState{}; gl.GetInt(LOCAL_GL_UNPACK_ALIGNMENT, &actual.alignmentInTypeElems); if (isWebgl2) { diff --git a/dom/canvas/TiedFields.h b/dom/canvas/TiedFields.h index 2df225aeee..a071da9dab 100644 --- a/dom/canvas/TiedFields.h +++ b/dom/canvas/TiedFields.h @@ -131,42 +131,34 @@ constexpr bool AssertTiedFieldsAreExhaustive() { // - /** - * Padding can be used to pad out a struct so that it's not implicitly - * padded by struct rules. - * You can also just add your padding to TiedFields, but by explicitly typing - * padding like this, serialization can make a choice whether to copy Padding, - * or instead to omit the copy. - * - * Omitting the copy isn't always faster. - * struct Entry { - * uint16_t key; - * Padding padding; - * uint32_t val; - * auto MutTiedFields() { return std::tie(key, padding, val); } - * }; - * If you serialize Padding, the serialized size is 8, and the compiler will - * optimize serialization to a single 8-byte memcpy. - * If your serialization omits Padding, the serialized size of Entry shrinks - * by 25%. If you have a big list of Entrys, maybe this is a big savings! - * However, by optimizing for size here you sacrifice speed, because this splits - * the single memcpy into two: a 2-byte memcpy and a 4-byte memcpy. - * - * Explicitly marking padding gives callers the option of choosing. + * PaddingField can be used to pad out a struct so that it's not + * implicitly padded by struct rules, but also can't be accidentally initialized + * via Aggregate Initialization. (TiedFields serialization checks rely on object + * fields leaving no implicit padding bytes, but explicit padding fields are + * fine) While you can use e.g. `uint8_t _padding[3];`, consider instead + * `PaddingField _padding;` for clarity and to move the `3` nearer + * to the `uint8_t`. */ -template -struct Padding { - T ignored; +template +struct PaddingField { + static_assert(!std::is_array_v, "Use PaddingField not ."); - friend constexpr bool operator==(const Padding&, const Padding&) { + std::array ignored = {}; + + PaddingField() {} + + friend constexpr bool operator==(const PaddingField&, const PaddingField&) { return true; } - friend constexpr bool operator<(const Padding&, const Padding&) { + friend constexpr bool operator<(const PaddingField&, const PaddingField&) { return false; } + + auto MutTiedFields() { return std::tie(ignored); } }; -static_assert(sizeof(Padding) == 1); -static_assert(sizeof(Padding) == 2); -static_assert(sizeof(Padding) == 4); +static_assert(sizeof(PaddingField) == 1); +static_assert(sizeof(PaddingField) == 2); +static_assert(sizeof(PaddingField) == 4); // - @@ -202,7 +194,7 @@ static_assert(AreAllBytesTiedFields()); struct Eel { // Like a Fish, but you can skip serializing the padding. bool b; - Padding padding[3]; + PaddingField padding; int i; constexpr auto MutTiedFields() { return std::tie(i, b, padding); } diff --git a/dom/canvas/WebGL2Context.h b/dom/canvas/WebGL2Context.h index 018c81f298..c8fbdef5ee 100644 --- a/dom/canvas/WebGL2Context.h +++ b/dom/canvas/WebGL2Context.h @@ -104,12 +104,8 @@ class WebGL2Context final : public WebGLContext { // ------------------------------------------------------------------------- // Sync objects - WebGL2ContextSync.cpp - const GLuint64 kMaxClientWaitSyncTimeoutNS = - 1000 * 1000 * 1000; // 1000ms in ns. - RefPtr FenceSync(GLenum condition, GLbitfield flags); - GLenum ClientWaitSync(const WebGLSync& sync, GLbitfield flags, - GLuint64 timeout); + GLenum ClientWaitSync(WebGLSync& sync, GLbitfield flags, GLuint64 timeout); // ------------------------------------------------------------------------- // Transform Feedback - WebGL2ContextTransformFeedback.cpp diff --git a/dom/canvas/WebGL2ContextState.cpp b/dom/canvas/WebGL2ContextState.cpp index b97592b570..b7d2f44000 100644 --- a/dom/canvas/WebGL2ContextState.cpp +++ b/dom/canvas/WebGL2ContextState.cpp @@ -81,10 +81,6 @@ Maybe WebGL2Context::GetParameter(GLenum pname) { return Some(4 * val); } - /* GLint64 */ - case LOCAL_GL_MAX_CLIENT_WAIT_TIMEOUT_WEBGL: - return Some(kMaxClientWaitSyncTimeoutNS); - case LOCAL_GL_MAX_ELEMENT_INDEX: // GL_MAX_ELEMENT_INDEX becomes available in GL 4.3 or via ES3 // compatibility diff --git a/dom/canvas/WebGL2ContextSync.cpp b/dom/canvas/WebGL2ContextSync.cpp index b0092ca682..e5a1b1bc7b 100644 --- a/dom/canvas/WebGL2ContextSync.cpp +++ b/dom/canvas/WebGL2ContextSync.cpp @@ -29,10 +29,12 @@ RefPtr WebGL2Context::FenceSync(GLenum condition, GLbitfield flags) { } RefPtr globj = new WebGLSync(this, condition, flags); + mPendingSyncs.emplace_back(globj); + EnsurePollPendingSyncs_Pending(); return globj; } -GLenum WebGL2Context::ClientWaitSync(const WebGLSync& sync, GLbitfield flags, +GLenum WebGL2Context::ClientWaitSync(WebGLSync& sync, GLbitfield flags, GLuint64 timeout) { const FuncScope funcScope(*this, "clientWaitSync"); if (IsContextLost()) return LOCAL_GL_WAIT_FAILED; @@ -44,19 +46,52 @@ GLenum WebGL2Context::ClientWaitSync(const WebGLSync& sync, GLbitfield flags, return LOCAL_GL_WAIT_FAILED; } - if (timeout > kMaxClientWaitSyncTimeoutNS) { - ErrorInvalidOperation("`timeout` must not exceed %s nanoseconds.", - "MAX_CLIENT_WAIT_TIMEOUT_WEBGL"); - return LOCAL_GL_WAIT_FAILED; - } - - const auto ret = gl->fClientWaitSync(sync.mGLName, flags, timeout); + const auto ret = sync.ClientWaitSync(flags, timeout); + return UnderlyingValue(ret); +} - if (ret == LOCAL_GL_CONDITION_SATISFIED || ret == LOCAL_GL_ALREADY_SIGNALED) { - sync.MarkSignaled(); +void WebGLContext::EnsurePollPendingSyncs_Pending() const { + if (mPollPendingSyncs_Pending) return; + mPollPendingSyncs_Pending = NS_NewRunnableFunction( + "WebGLContext::PollPendingSyncs", [weak = WeakPtr{this}]() { + if (const auto strong = RefPtr{weak.get()}) { + strong->mPollPendingSyncs_Pending = nullptr; + strong->PollPendingSyncs(); + if (strong->mPendingSyncs.size()) { + // Not done yet... + strong->EnsurePollPendingSyncs_Pending(); + } + } + }); + if (const auto eventTarget = GetCurrentSerialEventTarget()) { + eventTarget->DelayedDispatch(do_AddRef(mPollPendingSyncs_Pending), + kPollPendingSyncs_DelayMs); + } else { + NS_WARNING( + "[EnsurePollPendingSyncs_Pending] GetCurrentSerialEventTarget() -> " + "nullptr"); } +} - return ret; +void WebGLContext::PollPendingSyncs() const { + const FuncScope funcScope(*this, ""); + if (IsContextLost()) return; + + while (mPendingSyncs.size()) { + if (const auto sync = RefPtr{mPendingSyncs.front().get()}) { + const auto res = sync->ClientWaitSync(0, 0); + switch (res) { + case ClientWaitSyncResult::WAIT_FAILED: + case ClientWaitSyncResult::TIMEOUT_EXPIRED: + return; + case ClientWaitSyncResult::CONDITION_SATISFIED: + case ClientWaitSyncResult::ALREADY_SIGNALED: + // Communication back to child happens in sync->lientWaitSync. + break; + } + } + mPendingSyncs.pop_front(); + } } } // namespace mozilla diff --git a/dom/canvas/WebGLChild.cpp b/dom/canvas/WebGLChild.cpp index ebfe35db88..81ea1dcdd6 100644 --- a/dom/canvas/WebGLChild.cpp +++ b/dom/canvas/WebGLChild.cpp @@ -162,4 +162,11 @@ mozilla::ipc::IPCResult WebGLChild::RecvOnContextLoss( return IPC_OK(); } +mozilla::ipc::IPCResult WebGLChild::RecvOnSyncComplete( + const webgl::ObjectId id) const { + if (!mContext) return IPC_OK(); + mContext->OnSyncComplete(id); + return IPC_OK(); +} + } // namespace mozilla::dom diff --git a/dom/canvas/WebGLChild.h b/dom/canvas/WebGLChild.h index 6848237d8f..f4229e1b9b 100644 --- a/dom/canvas/WebGLChild.h +++ b/dom/canvas/WebGLChild.h @@ -58,6 +58,7 @@ class WebGLChild final : public PWebGLChild, public SupportsWeakPtr { public: mozilla::ipc::IPCResult RecvJsWarning(const std::string&) const; mozilla::ipc::IPCResult RecvOnContextLoss(webgl::ContextLossReason) const; + mozilla::ipc::IPCResult RecvOnSyncComplete(webgl::ObjectId) const; }; } // namespace dom diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp index ec19bfef3d..4bd189c46c 100644 --- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -881,6 +881,8 @@ void WebGLContext::OnEndOfFrame() { mDrawCallsSinceLastFlush = 0; + PollPendingSyncs(); + BumpLru(); } diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h index 5ab584174c..d144584f4f 100644 --- a/dom/canvas/WebGLContext.h +++ b/dom/canvas/WebGLContext.h @@ -303,6 +303,15 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr { uint64_t mNextFenceId = 1; uint64_t mCompletedFenceId = 0; + mutable std::list> mPendingSyncs; + mutable RefPtr mPollPendingSyncs_Pending; + static constexpr uint32_t kPollPendingSyncs_DelayMs = + 4; // Four times a frame. + public: + void EnsurePollPendingSyncs_Pending() const; + void PollPendingSyncs() const; + + protected: std::unique_ptr mIncompleteTexOverride; public: @@ -756,8 +765,6 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr { virtual Maybe GetParameter(GLenum pname); Maybe GetString(GLenum pname) const; - bool IsEnabled(GLenum cap); - private: static StaticMutex sLruMutex; static std::list sLru MOZ_GUARDED_BY(sLruMutex); @@ -780,8 +787,7 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr { }; ScissorRect mScissorRect = {}; - bool ValidateCapabilityEnum(GLenum cap); - bool* GetStateTrackingSlot(GLenum cap, GLuint i); + bool* GetStateTrackingSlot(GLenum cap); // Allocation debugging variables mutable uint64_t mDataAllocGLCallCount = 0; diff --git a/dom/canvas/WebGLContextState.cpp b/dom/canvas/WebGLContextState.cpp index f81e590436..e057a0195b 100644 --- a/dom/canvas/WebGLContextState.cpp +++ b/dom/canvas/WebGLContextState.cpp @@ -27,27 +27,25 @@ void WebGLContext::SetEnabled(const GLenum cap, const Maybe i, const FuncScope funcScope(*this, "enable(i)/disable(i)"); if (IsContextLost()) return; - if (!ValidateCapabilityEnum(cap)) return; - - if (i) { - if (cap != LOCAL_GL_BLEND) { - ErrorInvalidEnumArg("cap", cap); - return; - } - - const auto limit = MaxValidDrawBuffers(); - if (*i >= limit) { - ErrorInvalidValue("`index` (%u) must be < %s (%u)", *i, - "MAX_DRAW_BUFFERS", limit); - return; - } + static const auto webgl1Map = webgl::MakeIsEnabledMap(false); + static const auto webgl2Map = webgl::MakeIsEnabledMap(true); + const auto* map = &webgl2Map; + if (!IsWebGL2()) { + map = &webgl1Map; + } + if (!MaybeFind(*map, cap)) { + MOZ_ASSERT(false, "Bad cap."); + return; } - const auto slot = GetStateTrackingSlot(cap, i ? *i : 0); - if (slot) { - *slot = enabled; - } else if (cap == LOCAL_GL_BLEND) { + if (cap == LOCAL_GL_BLEND) { if (i) { + const auto limit = MaxValidDrawBuffers(); + if (*i >= limit) { + ErrorInvalidValue("`index` (%u) must be < %s (%u)", *i, + "MAX_DRAW_BUFFERS", limit); + return; + } mBlendEnabled[*i] = enabled; } else { if (enabled) { @@ -56,6 +54,15 @@ void WebGLContext::SetEnabled(const GLenum cap, const Maybe i, mBlendEnabled.reset(); } } + } else { + if (i) { + MOZ_ASSERT(false, "i"); + return; + } + const auto slot = GetStateTrackingSlot(cap); + if (slot) { + *slot = enabled; + } } switch (cap) { @@ -431,39 +438,7 @@ Maybe WebGLContext::GetParameter(const GLenum pname) { return Nothing(); } -bool WebGLContext::IsEnabled(GLenum cap) { - const FuncScope funcScope(*this, "isEnabled"); - if (IsContextLost()) return false; - - if (!ValidateCapabilityEnum(cap)) return false; - - const auto& slot = GetStateTrackingSlot(cap, 0); - if (slot) return *slot; - - return gl->fIsEnabled(cap); -} - -bool WebGLContext::ValidateCapabilityEnum(GLenum cap) { - 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("cap", cap); - return false; - } -} - -bool* WebGLContext::GetStateTrackingSlot(GLenum cap, GLuint i) { +bool* WebGLContext::GetStateTrackingSlot(GLenum cap) { switch (cap) { case LOCAL_GL_DEPTH_TEST: return &mDepthTestEnabled; diff --git a/dom/canvas/WebGLFramebuffer.cpp b/dom/canvas/WebGLFramebuffer.cpp index 108d2178cc..949177a217 100644 --- a/dom/canvas/WebGLFramebuffer.cpp +++ b/dom/canvas/WebGLFramebuffer.cpp @@ -352,10 +352,17 @@ Maybe WebGLFBAttachPoint::GetParameter(WebGLContext* webgl, 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_COMPONENT_TYPE: + isPNameValid = (webgl->IsWebGL2() || + webgl->IsExtensionEnabled( + WebGLExtensionID::WEBGL_color_buffer_float) || + webgl->IsExtensionEnabled( + WebGLExtensionID::EXT_color_buffer_half_float)); + break; + case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: isPNameValid = (webgl->IsWebGL2() || webgl->IsExtensionEnabled(WebGLExtensionID::EXT_sRGB)); @@ -404,7 +411,14 @@ Maybe WebGLFBAttachPoint::GetParameter(WebGLContext* webgl, break; case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: - MOZ_ASSERT(attachment != LOCAL_GL_DEPTH_STENCIL_ATTACHMENT); + if (attachment == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) { + webgl->ErrorInvalidOperation( + "Querying" + " FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE" + " against DEPTH_STENCIL_ATTACHMENT is an" + " error."); + return Nothing(); + } if (format->unsizedFormat == webgl::UnsizedFormat::DEPTH_STENCIL) { MOZ_ASSERT(attachment == LOCAL_GL_DEPTH_ATTACHMENT || @@ -1222,17 +1236,6 @@ Maybe WebGLFramebuffer::GetAttachmentParameter(GLenum attachEnum, 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( - "Querying" - " FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE" - " against DEPTH_STENCIL_ATTACHMENT is an" - " error."); - return Nothing(); - } - if (mDepthAttachment.Renderbuffer() != mStencilAttachment.Renderbuffer() || mDepthAttachment.Texture() != mStencilAttachment.Texture()) { mContext->ErrorInvalidOperation( diff --git a/dom/canvas/WebGLIpdl.h b/dom/canvas/WebGLIpdl.h index 5a35c05909..45a5c5ad64 100644 --- a/dom/canvas/WebGLIpdl.h +++ b/dom/canvas/WebGLIpdl.h @@ -244,6 +244,45 @@ struct ParamTraits final : public mozilla::dom::WebIDLEnumSerializer< mozilla::dom::PredefinedColorSpace> {}; +// - +// ParamTraits_IsEnumCase + +/* +`IsEnumCase(T) -> bool` guarantees that we never have false negatives or false +positives due to adding or removing enum cases to enums, and forgetting to +update their serializations. Also, it allows enums to be non-continguous, unlike +ContiguousEnumSerializer. +*/ + +template +struct ParamTraits_IsEnumCase { + static bool Write(MessageWriter* const writer, const T& in) { + MOZ_ASSERT(IsEnumCase(in)); + const auto shadow = static_cast>(in); + WriteParam(writer, shadow); + return true; + } + + static bool Read(MessageReader* const reader, T* const out) { + auto shadow = std::underlying_type_t{}; + if (!ReadParam(reader, &shadow)) return false; + const auto e = mozilla::AsValidEnum(shadow); + if (!e) return false; + *out = *e; + return true; + } +}; + +// - + +#define USE_IS_ENUM_CASE(T) \ + template <> \ + struct ParamTraits : public ParamTraits_IsEnumCase {}; + +USE_IS_ENUM_CASE(mozilla::webgl::OptionalRenderableFormatBits) + +#undef USE_IS_ENUM_CASE + // - // ParamTraits_TiedFields @@ -272,6 +311,10 @@ struct ParamTraits_TiedFields { } }; +template +struct ParamTraits> final + : public ParamTraits_TiedFields> {}; + // - template <> @@ -609,35 +652,6 @@ struct ParamTraits> final { } }; -// - - -template -struct ParamTraits_IsEnumCase { - using T = TT; - - static void Write(IPC::MessageWriter* const writer, const T& in) { - MOZ_RELEASE_ASSERT(IsEnumCase(in)); - WriteParam(writer, mozilla::UnderlyingValue(in)); - } - - static bool Read(IPC::MessageReader* const reader, T* const out) { - std::underlying_type_t rawVal; - if (!ReadParam(reader, &rawVal)) return false; - *out = static_cast(rawVal); - return IsEnumCase(*out); - } -}; - -// - - -#define USE_IS_ENUM_CASE(T) \ - template <> \ - struct ParamTraits : public ParamTraits_IsEnumCase {}; - -USE_IS_ENUM_CASE(mozilla::webgl::OptionalRenderableFormatBits) - -#undef USE_IS_ENUM_CASE - } // namespace IPC #endif diff --git a/dom/canvas/WebGLParent.cpp b/dom/canvas/WebGLParent.cpp index 44a0692b3f..e107d6cb50 100644 --- a/dom/canvas/WebGLParent.cpp +++ b/dom/canvas/WebGLParent.cpp @@ -462,15 +462,6 @@ IPCResult WebGLParent::RecvGetVertexAttrib(GLuint index, GLenum pname, return IPC_OK(); } -IPCResult WebGLParent::RecvIsEnabled(GLenum cap, bool* const ret) { - if (!mHost) { - return IPC_FAIL(this, "HostWebGLContext is not initialized."); - } - - *ret = mHost->IsEnabled(cap); - return IPC_OK(); -} - IPCResult WebGLParent::RecvOnMemoryPressure() { if (!mHost) { return IPC_FAIL(this, "HostWebGLContext is not initialized."); diff --git a/dom/canvas/WebGLParent.h b/dom/canvas/WebGLParent.h index 4cdc03e0ec..b3b4511e76 100644 --- a/dom/canvas/WebGLParent.h +++ b/dom/canvas/WebGLParent.h @@ -103,7 +103,6 @@ class WebGLParent : public PWebGLParent, public SupportsWeakPtr { IPCResult RecvGetUniform(ObjectId id, uint32_t loc, webgl::GetUniformData* ret); IPCResult RecvGetVertexAttrib(GLuint index, GLenum pname, Maybe* ret); - IPCResult RecvIsEnabled(GLenum cap, bool* ret); IPCResult RecvOnMemoryPressure(); IPCResult RecvValidateProgram(ObjectId id, bool* ret); diff --git a/dom/canvas/WebGLSync.cpp b/dom/canvas/WebGLSync.cpp index e4b196ab04..6a8e9403f7 100644 --- a/dom/canvas/WebGLSync.cpp +++ b/dom/canvas/WebGLSync.cpp @@ -23,10 +23,39 @@ WebGLSync::~WebGLSync() { mContext->gl->fDeleteSync(mGLName); } -void WebGLSync::MarkSignaled() const { - if (mContext->mCompletedFenceId < mFenceId) { - mContext->mCompletedFenceId = mFenceId; +ClientWaitSyncResult WebGLSync::ClientWaitSync(const GLbitfield flags, + const GLuint64 timeout) { + if (!mContext) return ClientWaitSyncResult::WAIT_FAILED; + if (IsKnownComplete()) return ClientWaitSyncResult::ALREADY_SIGNALED; + + auto ret = ClientWaitSyncResult::WAIT_FAILED; + bool newlyComplete = false; + const auto status = static_cast( + mContext->gl->fClientWaitSync(mGLName, 0, 0)); + switch (status) { + case ClientWaitSyncResult::TIMEOUT_EXPIRED: // Poll() -> false + case ClientWaitSyncResult::WAIT_FAILED: // Error + ret = status; + break; + case ClientWaitSyncResult::CONDITION_SATISFIED: // Should never happen, but + // tolerate it. + case ClientWaitSyncResult::ALREADY_SIGNALED: // Poll() -> true + newlyComplete = true; + ret = status; + break; + } + + if (newlyComplete) { + if (mContext->mCompletedFenceId < mFenceId) { + mContext->mCompletedFenceId = mFenceId; + } + MOZ_RELEASE_ASSERT(mOnCompleteTasks); + for (const auto& task : *mOnCompleteTasks) { + (*task)(); + } + mOnCompleteTasks = {}; } + return ret; } } // namespace mozilla diff --git a/dom/canvas/WebGLSync.h b/dom/canvas/WebGLSync.h index 22c77941e2..48ed2ee58f 100644 --- a/dom/canvas/WebGLSync.h +++ b/dom/canvas/WebGLSync.h @@ -11,9 +11,30 @@ namespace mozilla { namespace webgl { class AvailabilityRunnable; + +struct Task { + virtual ~Task() = default; + virtual void operator()() const = 0; +}; + +template +struct FnTask : public Task { + const F fn; + + explicit FnTask(F&& fn) : fn(std::move(fn)) {} + + virtual void operator()() const override { fn(); } +}; } // namespace webgl -class WebGLSync final : public WebGLContextBoundObject { +enum class ClientWaitSyncResult : GLenum { + WAIT_FAILED = LOCAL_GL_WAIT_FAILED, + TIMEOUT_EXPIRED = LOCAL_GL_TIMEOUT_EXPIRED, + CONDITION_SATISFIED = LOCAL_GL_CONDITION_SATISFIED, + ALREADY_SIGNALED = LOCAL_GL_ALREADY_SIGNALED, +}; + +class WebGLSync final : public WebGLContextBoundObject, public SupportsWeakPtr { friend class WebGL2Context; friend class webgl::AvailabilityRunnable; @@ -23,10 +44,22 @@ class WebGLSync final : public WebGLContextBoundObject { const uint64_t mFenceId; bool mCanBeAvailable = false; + std::optional>> mOnCompleteTasks = + std::vector>{}; + public: WebGLSync(WebGLContext* webgl, GLenum condition, GLbitfield flags); - void MarkSignaled() const; + ClientWaitSyncResult ClientWaitSync(GLbitfield flags, GLuint64 timeout); + + template + void OnCompleteTaskAdd(F&& fn) { + MOZ_RELEASE_ASSERT(mOnCompleteTasks); + auto task = std::make_unique>(std::move(fn)); + mOnCompleteTasks->push_back(std::move(task)); + } + + bool IsKnownComplete() const { return !mOnCompleteTasks; } private: ~WebGLSync() override; diff --git a/dom/canvas/WebGLTypes.h b/dom/canvas/WebGLTypes.h index c268047930..f5f78e98cb 100644 --- a/dom/canvas/WebGLTypes.h +++ b/dom/canvas/WebGLTypes.h @@ -1224,6 +1224,15 @@ inline bool StartsWith(const std::string_view str, // - +template +Maybe AsValidEnum(const std::underlying_type_t raw_val) { + const auto raw_enum = T{raw_val}; // This is the risk we prevent! + if (!IsEnumCase(raw_enum)) return {}; + return Some(raw_enum); +} + +// - + namespace webgl { // In theory, this number can be unbounded based on the driver. However, no @@ -1302,6 +1311,50 @@ struct ReinterpretToSpan { } }; +// - + +inline std::string Join(Span ss, + const std::string_view& delim) { + if (!ss.size()) return ""; + auto ret = std::string(); + { + auto chars = delim.size() * (ss.size() - 1); + for (const auto& s : ss) { + chars += s.size(); + } + ret.reserve(chars); + } + + ret = ss[0]; + ss = ss.subspan(1); + for (const auto& s : ss) { + ret += delim; + ret += s; + } + return ret; +} + +inline std::string ToStringWithCommas(uint64_t v) { + if (!v) return "0"; + std::vector chunks; + while (v) { + const auto chunk = v % 1000; + v /= 1000; + chunks.insert(chunks.begin(), std::to_string(chunk)); + } + return Join(chunks, ","); +} + +// - + +namespace webgl { + +std::unordered_map MakeIsEnabledMap(bool webgl2); + +static constexpr uint32_t kMaxClientWaitSyncTimeoutNS = + 1000 * 1000 * 1000; // 1000ms in ns. + +} // namespace webgl } // namespace mozilla #endif diff --git a/dom/canvas/test/crossorigin/mochitest.toml b/dom/canvas/test/crossorigin/mochitest.toml index e45b2624cd..0b62b02eab 100644 --- a/dom/canvas/test/crossorigin/mochitest.toml +++ b/dom/canvas/test/crossorigin/mochitest.toml @@ -7,6 +7,10 @@ support-files = [ "image.png", "video.sjs", ] +# The video used in those tests crash the Android emulator's VP9 decoder. +prefs = [ + "media.android-media-codec.enabled=false", +] ["test_canvas2d_crossorigin.html"] skip-if = [ diff --git a/dom/canvas/test/mochitest.toml b/dom/canvas/test/mochitest.toml index 3e96fff26b..6ab48c09c6 100644 --- a/dom/canvas/test/mochitest.toml +++ b/dom/canvas/test/mochitest.toml @@ -36,7 +36,11 @@ support-files = [ "offscreencanvas_serviceworker_inner.html", "crossorigin/image.png", "crossorigin/video.sjs", - "../../media/test/320x240.ogv", + "../../media/test/320x240.webm", +] +# The video used in those tests crash the Android emulator's VP9 decoder. +prefs = [ + "media.android-media-codec.enabled=false", ] ["test_2d.clearRect.image.offscreen.html"] diff --git a/dom/canvas/test/test_imagebitmap.html b/dom/canvas/test/test_imagebitmap.html index 7a68db08df..3c7958242b 100644 --- a/dom/canvas/test/test_imagebitmap.html +++ b/dom/canvas/test/test_imagebitmap.html @@ -6,7 +6,7 @@ - + @@ -226,7 +226,7 @@ function testSecurityErrors() { reject(); } - uncleanVideo.src = "http://example.com/tests/dom/canvas/test/crossorigin/video.sjs?name=tests/dom/canvas/test/320x240.ogv&type=video/ogg"; + uncleanVideo.src = "http://example.com/tests/dom/canvas/test/crossorigin/video.sjs?name=tests/dom/canvas/test/320x240.webm&type=video/webm"; uncleanVideo.play(); }); } diff --git a/dom/canvas/test/test_imagebitmap_cropping.html b/dom/canvas/test/test_imagebitmap_cropping.html index 56ccbf62e2..bb0f06f423 100644 --- a/dom/canvas/test/test_imagebitmap_cropping.html +++ b/dom/canvas/test/test_imagebitmap_cropping.html @@ -33,7 +33,7 @@ function isPixel(ctx, x, y, c, d) { } // -// The pattern of the 320x240.ogv video. +// The pattern of the 320x240.webm video. // .------------------------------------------------. // | 255 | 255 | 0 | 0 | 255 | 255 | 0 | // | 255 | 255 | 255 | 255 | 0 | 0 | 0 | @@ -135,7 +135,7 @@ var gJPEGBlob; function prepareSources() { gVideo = document.createElement("video"); - gVideo.src = "http://example.com/tests/dom/canvas/test/crossorigin/video.sjs?name=tests/dom/canvas/test/320x240.ogv&type=video/ogg&cors=anonymous"; + gVideo.src = "http://example.com/tests/dom/canvas/test/crossorigin/video.sjs?name=tests/dom/canvas/test/320x240.webm&type=video/webm&cors=anonymous"; gVideo.crossOrigin = "anonymous"; gVideo.autoplay = "true" 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 index 558163de17..c0cdadcd03 100644 --- 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 @@ -4,6 +4,8 @@ canvas-test.html canvas-zero-size.html drawingbuffer-static-canvas-test.html --min-version 1.0.2 drawingbuffer-hd-dpi-test.html +# Uncomment once fully passing on WebGL 1 +# --min-version 1.0.4 --max-version 1.9.9 drawingbuffer-storage-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 diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-storage-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-storage-test.html new file mode 100644 index 0000000000..285cd047d1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-storage-test.html @@ -0,0 +1,27 @@ + + + + + + +WebGL drawingBufferStorage Conformance Tests + + + + + + +
+
+ + + + 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 index 9a72b67ef0..e121e90676 100644 --- 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 @@ -1,15 +1,19 @@ --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-clip-control.html --min-version 1.0.4 ext-color-buffer-half-float.html +--min-version 1.0.4 ext-depth-clamp.html --min-version 1.0.4 ext-float-blend.html --min-version 1.0.4 ext-texture-compression-bptc.html --min-version 1.0.4 ext-texture-compression-rgtc.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.4 ext-polygon-offset-clamp.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.4 ext-texture-mirror-clamp-to-edge.html --min-version 1.0.2 get-extension.html --min-version 1.0.4 khr-parallel-shader-compile.html --max-version 1.9.9 oes-standard-derivatives.html @@ -29,6 +33,7 @@ --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 --min-version 1.0.4 --max-version 1.9.9 oes-fbo-render-mipmap.html +--min-version 1.0.4 --max-version 1.9.9 webgl-blend-func-extended.html webgl-debug-renderer-info.html webgl-debug-shaders.html --min-version 1.0.4 webgl-compressed-texture-astc.html @@ -44,3 +49,4 @@ webgl-debug-shaders.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.4 webgl-multi-draw.html +--min-version 1.0.4 webgl-polygon-mode.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-clip-control.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-clip-control.html new file mode 100644 index 0000000000..f5c557c839 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-clip-control.html @@ -0,0 +1,185 @@ + + + + + + +WebGL EXT_clip_control Conformance Tests + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-depth-clamp.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-depth-clamp.html new file mode 100644 index 0000000000..6082c9880c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-depth-clamp.html @@ -0,0 +1,168 @@ + + + + + + +WebGL EXT_depth_clamp 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 index 1fc29cc445..7965987c64 100644 --- 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 @@ -25,7 +25,9 @@ description("This test verifies the functionality of the EXT_disjoint_timer_quer var wtu = WebGLTestUtils; var canvas = document.getElementById("canvas"); var gl = wtu.create3DContext(canvas); +var gl2 = null; var ext = null; +var ext2 = null; var query = null; var query2 = null; var elapsed_query = null; @@ -61,6 +63,8 @@ if (!gl) { runTimeStampTest(); } verifyQueryResultsNotAvailable(); + verifyDeleteQueryBehavior(); + verifyDeleteQueryErrorBehavior(); window.requestAnimationFrame(checkQueryResults); } @@ -245,6 +249,61 @@ function verifyQueryResultsNotAvailable() { testPassed("Queries' results didn't become available in a spin loop"); } +function verifyDeleteQueryBehavior() { + debug(""); + debug("Testing deleting an active query should end it."); + + // Use a new context for this test + gl2 = wtu.create3DContext(null, null, 1); + if (!gl2) return; + ext2 = gl2.getExtension("EXT_disjoint_timer_query"); + if (!ext2) return; + + query = ext2.createQueryEXT(); + ext2.beginQueryEXT(ext2.TIME_ELAPSED_EXT, query); + wtu.glErrorShouldBe(gl2, gl2.NONE, "The query began successfully"); + ext2.deleteQueryEXT(query); + wtu.glErrorShouldBe(gl2, gl2.NONE, "Deletion of the active query succeeds"); + shouldBeNull("ext2.getQueryEXT(ext2.TIME_ELAPSED_EXT, ext2.CURRENT_QUERY_EXT)"); + shouldBeFalse("ext2.isQueryEXT(query)"); + query = ext2.createQueryEXT(); + ext2.beginQueryEXT(ext2.TIME_ELAPSED_EXT, query); + wtu.glErrorShouldBe(gl2, gl2.NONE, "Beginning a new query succeeds"); + ext2.endQueryEXT(ext2.TIME_ELAPSED_EXT); + ext2.deleteQueryEXT(query); + wtu.glErrorShouldBe(gl2, gl2.NONE); + query = null; + ext2 = null; + gl2 = null; +} + +function verifyDeleteQueryErrorBehavior() { + debug(""); + debug("Testing deleting a query created by another context."); + + // Use new contexts for this test + gl2 = wtu.create3DContext(null, null, 1); + var gl3 = wtu.create3DContext(null, null, 1); + if (!gl2 || !gl3) return; + ext2 = gl2.getExtension("EXT_disjoint_timer_query"); + var ext3 = gl3.getExtension("EXT_disjoint_timer_query"); + if (!ext2 || !ext3) return; + + query = ext2.createQueryEXT(); + ext2.beginQueryEXT(ext2.TIME_ELAPSED_EXT, query); + ext3.deleteQueryEXT(query); + wtu.glErrorShouldBe(gl3, gl3.INVALID_OPERATION); + shouldBeTrue("ext2.isQueryEXT(query)"); + shouldBe("ext2.getQueryEXT(ext2.TIME_ELAPSED_EXT, ext2.CURRENT_QUERY_EXT)", "query"); + ext2.endQueryEXT(ext2.TIME_ELAPSED_EXT); + ext2.deleteQueryEXT(query); + wtu.glErrorShouldBe(gl2, gl2.NONE); + query = null; + ext2 = null; + gl2 = null; + gl3 = null; +} + function checkQueryResults() { if (availability_retry > 0) { // Make a reasonable attempt to wait for the queries' results to become available. diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-polygon-offset-clamp.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-polygon-offset-clamp.html new file mode 100644 index 0000000000..ce14e96fc7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-polygon-offset-clamp.html @@ -0,0 +1,172 @@ + + + + + + +WebGL EXT_polygon_offset_clamp 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 index 7e8353f7f2..a997bdb4ab 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-sRGB.html +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-sRGB.html @@ -222,6 +222,40 @@ if (!gl) { runFormatTest(textureFormatFixture, false); runFormatTest(renderbufferFormatFixture, false); + { + var fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + debug("Checking getFramebufferAttachmentParameter with a renderbuffer"); + { + var rbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB565, 1, 1); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0x8210 /* FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT */)'); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + gl.deleteRenderbuffer(rbo); + } + + debug("Checking getFramebufferAttachmentParameter with a texture"); + { + var tex = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0x8210 /* FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT */)'); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM); + gl.bindTexture(gl.TEXTURE_2D, null); + gl.deleteTexture(tex); + } + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteFramebuffer(fbo); + } + debug(""); debug("Checking sRGB texture support"); diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-rgtc.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-rgtc.html index 70dcf9ba7b..d9c34af25f 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-rgtc.html +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-rgtc.html @@ -120,16 +120,16 @@ function runTestExtension() { gl.bindTexture(gl.TEXTURE_2D, tex); gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_RED_RGTC1_EXT, 4, 4, 0, gl.RED, gl.UNSIGNED_BYTE, null); - wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "COMPRESSED_RED_RGTC1_EXT fails with texImage2D"); + wtu.glErrorShouldBe(gl, [gl.INVALID_VALUE, gl.INVALID_OPERATION], "COMPRESSED_RED_RGTC1_EXT fails with texImage2D"); gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_SIGNED_RED_RGTC1_EXT, 4, 4, 0, gl.RED, gl.BYTE, null); - wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "COMPRESSED_SIGNED_RED_RGTC1_EXT fails with texImage2D"); + wtu.glErrorShouldBe(gl, [gl.INVALID_VALUE, gl.INVALID_OPERATION], "COMPRESSED_SIGNED_RED_RGTC1_EXT fails with texImage2D"); gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_RED_GREEN_RGTC2_EXT, 4, 4, 0, gl.RG, gl.UNSIGNED_BYTE, null); - wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "COMPRESSED_RED_GREEN_RGTC2_EXT fails with texImage2D"); + wtu.glErrorShouldBe(gl, [gl.INVALID_VALUE, gl.INVALID_OPERATION], "COMPRESSED_RED_GREEN_RGTC2_EXT fails with texImage2D"); gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT, 4, 4, 0, gl.RG, gl.BYTE, null); - wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT fails with texImage2D"); + wtu.glErrorShouldBe(gl, [gl.INVALID_VALUE, gl.INVALID_OPERATION], "COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT fails with texImage2D"); gl.deleteTexture(tex); } diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-mirror-clamp-to-edge.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-mirror-clamp-to-edge.html new file mode 100644 index 0000000000..4e2f980b4b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-mirror-clamp-to-edge.html @@ -0,0 +1,217 @@ + + + + + + +WebGL EXT_texture_mirror_clamp_to_edge Conformance Tests + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/khr-parallel-shader-compile.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/khr-parallel-shader-compile.html index 2915a2d2de..6a8b1981e5 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/khr-parallel-shader-compile.html +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/khr-parallel-shader-compile.html @@ -169,6 +169,32 @@ let extraCode = ''; testPassed(`COMPLETION_STATUS_KHR sucessfully transitioned from false to true`); } + debug("Checking that compiling lots of programs in parallel eventually completes."); + let programs = []; + for (let i = 0; i < 256; ++i) { + gl.shaderSource(vs, vertexSource()); + gl.shaderSource(fs, fragmentSource()); + gl.compileShader(vs); + gl.compileShader(fs); + let program = gl.createProgram(); + gl.attachShader(program, vs); + gl.attachShader(program, fs); + gl.linkProgram(program); + programs.push(program); + } + let allDone = false; + while (!allDone) { + allDone = true; + for (let i = 0; i < programs.length; ++i) { + if (!gl.getProgramParameter(programs[i], COMPLETION_STATUS_KHR)) { + allDone = false; + break; + } + } + if (!allDone) { + await new Promise(requestAnimationFrame); + } + } debug("Checking that status is true when context is lost."); if (loseContext) { 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 index 3ccbd50f15..cb406706f9 100644 --- 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 @@ -33,7 +33,6 @@ function testPrologue(gl) { 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 index a757cb22ec..8bec35b9cf 100644 --- 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 @@ -60,6 +60,7 @@ debug(""); var wtu = WebGLTestUtils; var canvas = document.getElementById("canvas"); var gl = wtu.create3DContext(canvas); +var ext = null; if (!gl) { testFailed("WebGL context does not exist"); @@ -81,6 +82,33 @@ if (!gl) { // the extension has not been enabled yet. runTextureCreationTest(testProgram, false); + { + debug(""); + debug("Testing that component type framebuffer attachment queries are rejected with the extension disabled"); + const fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + const rbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,gl.RENDERBUFFER, rbo); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB565, 8, 8); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Setup renderbuffer should succeed."); + shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0x8211 /* FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT */)'); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Query must fail."); + gl.deleteRenderbuffer(rbo); + + const tex = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 8, 8, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Setup texture should succeed."); + shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0x8211 /* FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT */)'); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Query must fail."); + gl.deleteTexture(tex); + + gl.deleteFramebuffer(fbo); + } + if (!gl.getExtension("OES_texture_float")) { testPassed("No OES_texture_float support -- this is legal"); } else { @@ -109,6 +137,43 @@ if (!gl) { runRenderTargetAndReadbackTest(testProgram, gl.RGBA, 4, [10000, 10000, 10000, 10000], 0.5, true); runFramebufferTest(); + { + debug(""); + debug("Testing that component type framebuffer attachment queries are accepted with the extension enabled"); + ext = gl.getExtension("WEBGL_color_buffer_float"); + shouldBeNonNull('ext'); + const fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + const rbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,gl.RENDERBUFFER, rbo); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB565, 8, 8); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)', 'ext.UNSIGNED_NORMALIZED_EXT'); + gl.renderbufferStorage(gl.RENDERBUFFER, ext.RGBA32F_EXT, 8, 8); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)', 'gl.FLOAT'); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No errors after valid renderbuffer attachment queries."); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT,gl.RENDERBUFFER, rbo); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, 8, 8); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No errors after depth-stencil renderbuffer setup."); + shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)'); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Component type query is not allowed for combined depth-stencil attachments."); + gl.deleteRenderbuffer(rbo); + + const tex = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 8, 8, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)', 'ext.UNSIGNED_NORMALIZED_EXT'); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 8, 8, 0, gl.RGBA, gl.FLOAT, null); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)', 'gl.FLOAT'); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No errors after valid texture attachment queries."); + gl.deleteTexture(tex); + + gl.deleteFramebuffer(fbo); + } + debug(""); debug("Test float32 blending without EXT_float_blend."); testExtFloatBlend(gl.RGBA); 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 index 719b332113..d6076b29f9 100644 --- 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 @@ -38,7 +38,6 @@ function testPrologue(gl) { diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-blend-func-extended.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-blend-func-extended.html new file mode 100644 index 0000000000..62e25adaa2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-blend-func-extended.html @@ -0,0 +1,26 @@ + + + + + + +WebGL 1.0 WEBGL_blend_func_extended Conformance Tests + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-polygon-mode.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-polygon-mode.html new file mode 100644 index 0000000000..fd65f692a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-polygon-mode.html @@ -0,0 +1,185 @@ + + + + + + +WebGL WEBGL_polygon_mode Conformance Tests + + + + + + +
+
+ + + + 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 index 078b436427..3791be2448 100644 --- 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 @@ -39,6 +39,43 @@ function runTest(canvas, antialias) { gl = wtu.create3DContext(canvas, {antialias: antialias}); var contextVersion = wtu.getDefault3DContextVersion(); + debug(""); + debug("Test null pixels"); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, null); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "null pixels"); + + debug(""); + debug("Test pixels size"); + gl.readPixels(0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(0)); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "empty pixels array with 0x0 read data"); + gl.readPixels(0, 0, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(0)); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "empty pixels array with 1x0 read data"); + gl.readPixels(0, 0, 0, 1, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(0)); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "empty pixels array with 0x1 read data"); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(3)); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "small pixels array for 1x1 read data"); + if (contextVersion >= 2) { + gl.readPixels(0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(0), 1); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "offset is greater than array size"); + gl.readPixels(0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(1), 1); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no space left in pixels array with 0x0 read data"); + gl.readPixels(0, 0, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(1), 1); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no space left in pixels array with 1x0 read data"); + gl.readPixels(0, 0, 0, 1, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(1), 1); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no space left in pixels array with 0x1 read data"); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4), 1); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "no space left in pixels array with 1x1 read data"); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(5), 1); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "read 1x1 data fits into pixels with offset"); + } + + debug(""); + debug("Test combined depth-stencil type"); + // The combined type is undefined in WebGL 1.0 and never allowed as a read type in WebGL 2.0 + gl.readPixels(0, 0, 1, 1, gl.RGBA, 0x8DAD /* FLOAT_32_UNSIGNED_INT_24_8_REV */, new Uint8Array(32)); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "FLOAT_32_UNSIGNED_INT_24_8_REV is rejected"); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no extra error generated"); + var width = 2; var height = 2; var continueTestFunc = continueTestPart1; diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/exif-orientation.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/exif-orientation.html index 3fd596d445..5a4b88e5b8 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/exif-orientation.html +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/exif-orientation.html @@ -56,35 +56,20 @@ function checkPixels(flipY) } } -async function testImageBitmapFromBlobWithFlipY(blob, flipY) +async function testImageBitmapWithFlipY(source, flipY) { - let bitmap; - // As a concession to Firefox, which doesn't yet implement - // createImageBitmap with creation options, skip the tests - // involving flipY=true if ImageBitmap creation throws an - // exception, and use the single-argument constructor for the - // flipY=false case. - if (flipY) { - try { - bitmap = await createImageBitmap(blob, {imageOrientation: flipY}); - } catch (e) { - output(" (createImageBitmap options not supported - skipping flipY=true case)"); - return; - } - } else { - bitmap = await createImageBitmap(blob); - } + const bitmap = await createImageBitmap(source, flipY ? {imageOrientation: flipY} : undefined); output(" Testing texImage2D, flipY = " + flipY); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, bitmap); wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); - checkPixels(flipY); + checkPixels(flipY == "flipY"); output(" Testing texSubImage2D, flipY = " + flipY); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, bitmap.width, bitmap.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, bitmap); wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); - checkPixels(flipY); + checkPixels(flipY == "flipY"); } async function testImageBitmapFromBlob(filename) @@ -93,8 +78,16 @@ async function testImageBitmapFromBlob(filename) let blob = await response.blob(); output("----------------------------------------------------------------"); output("Testing " + filename + " via ImageBitmap from Blob"); - await testImageBitmapFromBlobWithFlipY(blob, true); - await testImageBitmapFromBlobWithFlipY(blob, false); + await testImageBitmapWithFlipY(blob, "flipY"); + await testImageBitmapWithFlipY(blob, "none"); + await testImageBitmapWithFlipY(blob, undefined); +} + +async function testImageBitmapFromImage(image) +{ + await testImageBitmapWithFlipY(image, "flipY"); + await testImageBitmapWithFlipY(image, "none"); + await testImageBitmapWithFlipY(image, undefined); } async function testImageElementWithFlipY(image, flipY) @@ -124,6 +117,11 @@ async function testImageElement(filename) await testImageElementWithFlipY(image, true); await testImageElementWithFlipY(image, false); + + output("----------------------------------------------------------------"); + output("Testing " + filename + " via ImageBitmap from HTMLImageElement"); + + await testImageBitmapFromImage(image); } async function testSingleImage(filename) @@ -149,9 +147,9 @@ async function run() "exif-orientation-test-3-rotate-180.jpg", "exif-orientation-test-4-mirror-vertical.jpg", "exif-orientation-test-5-mirror-horizontal-90-ccw.jpg", - "exif-orientation-test-6-90-ccw.jpg", + "exif-orientation-test-6-90-cw.jpg", "exif-orientation-test-7-mirror-horizontal-90-cw.jpg", - "exif-orientation-test-8-90-cw.jpg", + "exif-orientation-test-8-90-ccw.jpg", ]; for (let fn of filenames) { diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-video-using-tex-unit-non-zero.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-video-using-tex-unit-non-zero.html index ee9bad4341..1acc3a4380 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-video-using-tex-unit-non-zero.html +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-video-using-tex-unit-non-zero.html @@ -96,8 +96,6 @@ found in the LICENSE.txt file. type: 'video/webm; codecs="vp8, vorbis"' }, { src: resourcePath + "red-green.bt601.vp9.webm", type: 'video/webm; codecs="vp9"' }, - { src: resourcePath + "red-green.theora.ogv", - type: 'video/ogg; codecs="theora, vorbis"' }, ]; var currentVideo = null; 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 index ef979d4c5a..9a8e3198ba 100644 --- 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 @@ -154,7 +154,6 @@ function runTest(videoElement) diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-srgb-upload.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-srgb-upload.html index 3508670563..6f66bfdde6 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-srgb-upload.html +++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-srgb-upload.html @@ -62,12 +62,22 @@ function invoke(fn) { return fn(); } invoke(async () => { const video = document.createElement("video"); video.src = DATA_URL_FOR_720p_png_bt709_bt709_tv_yuv420p_vp9_webm; - //video.src = "Big_Buck_Bunny_360_10s_1MB.mp4"; - //video.src = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"; + if (!video.canPlayType('video/webm')) { + debug('Browser can not play webm videos. Skipping test.'); + finishTest(); + return; + } + video.muted = true; video.loop = true; video.crossOrigin = "anonymous"; - await video.play(); + try { + await video.play(); + } catch (e) { + debug('Browser could not play this specific video. Skipping test.'); + finishTest(); + return; + } function renderTex(canvas, fn_tex_image) { const gl = canvas.gl = wtu.create3DContext(canvas); 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 index a0f30dc89f..b5ba6afed3 100644 --- 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 @@ -99,7 +99,6 @@ var tests = [ {type: "video", src: "../../../resources/red-green.mp4", videoType: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"'}, {type: "video", src: "../../../resources/red-green.bt601.vp9.webm", videoType: 'video/webm; codecs="vp9"'}, {type: "video", src: "../../../resources/red-green.webmvp8.webm", videoType: 'video/webm; codecs="vp8, vorbis"'}, - {type: "video", src: "../../../resources/red-green.theora.ogv", videoType: 'video/ogg; codecs="theora, vorbis"'}, ]; var testIndex = 0; 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 index 3b1c185caf..6de8114651 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-location.html +++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-location.html @@ -68,6 +68,10 @@ contextA.stencilMask(1); wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.linkProgram(programS)"); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform1i(locationSx, 3)"); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getUniform(programS, locationSx)"); +// Make sure that with no current program, uniform location validation doesn't get confused. +wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(null)"); +wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform1i(locationSx, 3)"); +wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(programS)"); // Retrieve the locations again, and they should be good. locationSx = contextA.getUniformLocation(programS, "u_struct.x"); 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 index e251dc9758..fabc72c1da 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance2/00_test_list.txt +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/00_test_list.txt @@ -18,3 +18,4 @@ textures/00_test_list.txt transform_feedback/00_test_list.txt uniforms/00_test_list.txt vertex_arrays/00_test_list.txt +--min-version 2.0.1 wasm/00_test_list.txt diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/canvas/00_test_list.txt index 35e011f3bf..878a2797c4 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance2/canvas/00_test_list.txt +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/canvas/00_test_list.txt @@ -1 +1,2 @@ +--min-version 2.0.1 drawingbuffer-storage-test.html --min-version 2.0.1 to-data-url-with-pack-params.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/canvas/drawingbuffer-storage-test.html b/dom/canvas/test/webgl-conf/checkout/conformance2/canvas/drawingbuffer-storage-test.html new file mode 100644 index 0000000000..6f18d441c0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/canvas/drawingbuffer-storage-test.html @@ -0,0 +1,27 @@ + + + + + + +WebGL2 drawingBufferStorage Conformance Tests + + + + + + +
+
+ + + + 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 index 559071ff06..2cc4456ecb 100644 --- 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 @@ -1,11 +1,16 @@ ext-color-buffer-float.html --min-version 2.0.1 ext-color-buffer-half-float.html +--min-version 2.0.1 ext-conservative-depth.html ext-disjoint-timer-query-webgl2.html +--min-version 2.0.1 ext-render-snorm.html --min-version 2.0.1 ext-texture-filter-anisotropic.html --min-version 2.0.1 ext-texture-norm16.html promoted-extensions.html promoted-extensions-in-shaders.html +--min-version 2.0.1 nv-shader-noperspective-interpolation.html --min-version 2.0.1 oes-draw-buffers-indexed.html +--min-version 2.0.1 oes-sample-variables.html +--min-version 2.0.1 oes-shader-multisample-interpolation.html --min-version 2.0.1 ovr_multiview2.html --min-version 2.0.1 ovr_multiview2_depth.html --min-version 2.0.1 ovr_multiview2_draw_buffers.html @@ -16,4 +21,10 @@ promoted-extensions-in-shaders.html --min-version 2.0.1 ovr_multiview2_timer_query.html --min-version 2.0.1 ovr_multiview2_transform_feedback.html --min-version 2.0.1 required-extensions.html +--min-version 2.0.1 webgl-blend-func-extended.html +--min-version 2.0.1 webgl-clip-cull-distance.html --min-version 2.0.1 webgl-multi-draw-instanced-base-vertex-base-instance.html +--min-version 2.0.1 webgl-provoking-vertex.html +--min-version 2.0.1 webgl-render-shared-exponent.html +--min-version 2.0.1 webgl-shader-pixel-local-storage.html +--min-version 2.0.1 webgl-stencil-texturing.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-conservative-depth.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-conservative-depth.html new file mode 100644 index 0000000000..c9c9f85bdb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-conservative-depth.html @@ -0,0 +1,145 @@ + + + + + + +WebGL EXT_conservative_depth 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 index c051fa36a3..f1e9a82d8a 100644 --- 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 @@ -25,7 +25,9 @@ description("This test verifies the functionality of the EXT_disjoint_timer_quer var wtu = WebGLTestUtils; var canvas = document.getElementById("canvas"); var gl = wtu.create3DContext(canvas, null, 2); +var gl2 = null; var ext = null; +var ext2 = null; var query = null; var query2 = null; var elapsed_query = null; @@ -62,6 +64,8 @@ if (!gl) { wtu.glErrorShouldBe(gl, gl.NO_ERROR); } verifyQueryResultsNotAvailable(); + verifyDeleteQueryBehavior(); + verifyDeleteQueryErrorBehavior(); wtu.glErrorShouldBe(gl, gl.NO_ERROR); window.requestAnimationFrame(checkQueryResults); @@ -249,6 +253,60 @@ function verifyQueryResultsNotAvailable() { testPassed("Queries' results didn't become available in a spin loop"); } +function verifyDeleteQueryBehavior() { + debug(""); + debug("Testing deleting an active query should end it."); + + // Use a new context for this test + gl2 = wtu.create3DContext(null, null, 2); + if (!gl2) return; + ext2 = gl2.getExtension("EXT_disjoint_timer_query_webgl2"); + if (!ext2) return; + + query = gl2.createQuery(); + gl2.beginQuery(ext.TIME_ELAPSED_EXT, query); + wtu.glErrorShouldBe(gl2, gl2.NONE, "The query began successfully"); + gl2.deleteQuery(query); + wtu.glErrorShouldBe(gl2, gl2.NONE, "Deletion of the active query succeeds"); + shouldBeNull("gl2.getQuery(ext2.TIME_ELAPSED_EXT, gl2.CURRENT_QUERY)"); + shouldBeFalse("gl2.isQuery(query)"); + query = gl2.createQuery(); + gl2.beginQuery(ext2.TIME_ELAPSED_EXT, query); + wtu.glErrorShouldBe(gl, gl2.NONE, "Beginning a new query succeeds"); + gl2.endQuery(gl2.TIME_ELAPSED_EXT); + gl2.deleteQuery(query); + wtu.glErrorShouldBe(gl, gl.NONE); + query = null; + ext2 = null; + gl2 = null; +} + +function verifyDeleteQueryErrorBehavior() { + debug(""); + debug("Testing deleting a query created by another context."); + + // Use new contexts for this test + gl2 = wtu.create3DContext(null, null, 2); + var gl3 = wtu.create3DContext(null, null, 2); + if (!gl2 || !gl3) return; + ext2 = gl2.getExtension("EXT_disjoint_timer_query_webgl2"); + if (!ext2) return; + + query = gl2.createQuery(); + gl2.beginQuery(ext2.TIME_ELAPSED_EXT, query); + gl3.deleteQuery(query); + wtu.glErrorShouldBe(gl3, gl3.INVALID_OPERATION); + shouldBeTrue("gl2.isQuery(query)"); + shouldBe("gl2.getQuery(ext2.TIME_ELAPSED_EXT, gl2.CURRENT_QUERY)", "query"); + gl2.endQuery(ext2.TIME_ELAPSED_EXT); + gl2.deleteQuery(query); + wtu.glErrorShouldBe(gl2, gl2.NONE); + query = null; + ext2 = null; + gl2 = null; + gl3 = null; +} + function checkQueryResults() { if (availability_retry > 0) { // Make a reasonable attempt to wait for the queries' results to become available. diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-render-snorm.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-render-snorm.html new file mode 100644 index 0000000000..723e762773 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-render-snorm.html @@ -0,0 +1,201 @@ + + + + + + +WebGL EXT_render_snorm Conformance Tests + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/nv-shader-noperspective-interpolation.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/nv-shader-noperspective-interpolation.html new file mode 100644 index 0000000000..2198c17b1a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/nv-shader-noperspective-interpolation.html @@ -0,0 +1,251 @@ + + + + + + +WebGL NV_shader_noperspective_interpolation Conformance Tests + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/oes-sample-variables.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/oes-sample-variables.html new file mode 100644 index 0000000000..41fc8f8242 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/oes-sample-variables.html @@ -0,0 +1,474 @@ + + + + + + +WebGL OES_sample_variables Conformance Tests + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/oes-shader-multisample-interpolation.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/oes-shader-multisample-interpolation.html new file mode 100644 index 0000000000..dcb272c2f0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/oes-shader-multisample-interpolation.html @@ -0,0 +1,313 @@ + + + + + + +WebGL OES_shader_multisample_interpolation Conformance Tests + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-blend-func-extended.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-blend-func-extended.html new file mode 100644 index 0000000000..792e9aafa7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-blend-func-extended.html @@ -0,0 +1,26 @@ + + + + + + +WebGL 2.0 WEBGL_blend_func_extended Conformance Tests + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-clip-cull-distance.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-clip-cull-distance.html new file mode 100644 index 0000000000..cb2253c326 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-clip-cull-distance.html @@ -0,0 +1,475 @@ + + + + + + +WebGL WEBGL_clip_cull_distance Conformance Tests + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-provoking-vertex.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-provoking-vertex.html new file mode 100644 index 0000000000..3737409b3a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-provoking-vertex.html @@ -0,0 +1,165 @@ + + + + + + +WebGL WEBGL_provoking_vertex Conformance Tests + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-render-shared-exponent.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-render-shared-exponent.html new file mode 100644 index 0000000000..11d505fcc6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-render-shared-exponent.html @@ -0,0 +1,251 @@ + + + + + + +WebGL WEBGL_render_shared_exponent Conformance Tests + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-shader-pixel-local-storage.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-shader-pixel-local-storage.html new file mode 100644 index 0000000000..e548eea46c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-shader-pixel-local-storage.html @@ -0,0 +1,445 @@ + + + + +WebGL WEBGL_shader_pixel_local_storage Conformance Tests + + + + + + + + +
+ + +
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-stencil-texturing.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-stencil-texturing.html new file mode 100644 index 0000000000..729a5bcf8a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/webgl-stencil-texturing.html @@ -0,0 +1,279 @@ + + + + + + +WebGL WEBGL_stencil_texturing Conformance Tests + + + + + +
+
+ + + + 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 index 5a47d470f9..9e8bc87a62 100644 --- 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 @@ -41,6 +41,7 @@ shader-with-invalid-characters.html shader-with-mis-matching-uniform-block.html short-circuiting-in-loop-condition.html --min-version 2.0.1 switch-case.html +--min-version 2.0.1 texture-bias.html --min-version 2.0.1 texture-offset-non-constant-offset.html texture-offset-out-of-range.html --min-version 2.0.1 texture-offset-uniform-texture-coordinate.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-bias.html b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-bias.html new file mode 100644 index 0000000000..0c30eb7129 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/texture-bias.html @@ -0,0 +1,146 @@ + + + + + + +GLSL texture bias test + + + + + + +
+
+ + + 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 index c40921bf88..a2e21b5ad7 100644 --- 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 @@ -1,2 +1,3 @@ occlusion-query.html +--min-version 2.0.1 occlusion-query-scissor.html query.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/query/occlusion-query-scissor.html b/dom/canvas/test/webgl-conf/checkout/conformance2/query/occlusion-query-scissor.html new file mode 100644 index 0000000000..dec88e56d3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/query/occlusion-query-scissor.html @@ -0,0 +1,117 @@ + + + + + + +WebGL Occlusion Query w/Scissor Conformance Tests + + + + + +
+ +
+ + + 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 index 754ff2cc73..bc4d623446 100644 --- 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 @@ -111,9 +111,10 @@ function testFramebufferWebGL1RequiredCombinations() { gl.deleteFramebuffer(fbo); } -function testDepthStencilAttachmentBehaviors() { +function testDepthStencilAttachmentBehaviors(testOrphanedRenderbuffers) { + let suffix = testOrphanedRenderbuffers ? " with deleted renderbuffer" : ""; debug(""); - debug("Checking ES3 DEPTH_STENCIL_ATTACHMENT behaviors are implemented for WebGL 2"); + debug("Checking ES3 DEPTH_STENCIL_ATTACHMENT behaviors are implemented for WebGL 2" + suffix); // DEPTH_STENCIL_ATTACHMENT is treated as an independent attachment point in WebGL 1; // however, in WebGL 2, it is treated as an alias for DEPTH_ATTACHMENT + STENCIL_ATTACHMENT. var size = 16; @@ -127,24 +128,45 @@ function testDepthStencilAttachmentBehaviors() { gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, size, size); checkFramebuffer([gl.FRAMEBUFFER_COMPLETE]); - var depthBuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, size, size); + function createDepthBuffer() { + let buffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, buffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, size, size); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + return buffer; + } + + function createStencilBuffer() { + let buffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, buffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, size, size); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + return buffer; + } - var stencilBuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, size, size); + function createDepthStencilBuffer() { + let buffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, buffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, size, size); + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + return buffer; + } - var depthStencilBuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, size, size); + function orphan(renderbuffer) { + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.deleteRenderbuffer(renderbuffer); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + } wtu.glErrorShouldBe(gl, gl.NO_ERROR); debug(""); - debug("color + depth"); + debug("color + depth" + suffix); + var depthBuffer = createDepthBuffer(); gl.framebufferRenderbuffer( gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthBuffer); + if (testOrphanedRenderbuffers) + orphan(depthBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", null); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", null); @@ -153,9 +175,12 @@ function testDepthStencilAttachmentBehaviors() { checkBufferBits(gl.DEPTH_ATTACHMENT); debug(""); - debug("color + depth + stencil: depth != stencil"); + debug("color + depth + stencil: depth != stencil" + suffix); + var stencilBuffer = createStencilBuffer(); gl.framebufferRenderbuffer( gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, stencilBuffer); + if (testOrphanedRenderbuffers) + orphan(stencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", stencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", null); @@ -170,9 +195,12 @@ function testDepthStencilAttachmentBehaviors() { wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION); debug(""); - debug("color + depth: DEPTH_STENCIL for DEPTH_ATTACHMENT"); + debug("color + depth: DEPTH_STENCIL for DEPTH_ATTACHMENT" + suffix); + var depthStencilBuffer = createDepthStencilBuffer(); gl.framebufferRenderbuffer( gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + if (testOrphanedRenderbuffers) + orphan(depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", null); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", null); @@ -181,9 +209,16 @@ function testDepthStencilAttachmentBehaviors() { checkBufferBits(gl.DEPTH_ATTACHMENT); debug(""); - debug("color + depth + stencil: DEPTH_STENCIL for DEPTH_ATTACHMENT and STENCIL_ATTACHMENT"); + debug("color + depth + stencil: DEPTH_STENCIL for DEPTH_ATTACHMENT and STENCIL_ATTACHMENT" + suffix); + if (testOrphanedRenderbuffers) { + depthStencilBuffer = createDepthStencilBuffer(); + gl.framebufferRenderbuffer( + gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + } gl.framebufferRenderbuffer( gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + if (testOrphanedRenderbuffers) + orphan(depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); @@ -192,7 +227,7 @@ function testDepthStencilAttachmentBehaviors() { checkBufferBits(gl.DEPTH_STENCIL_ATTACHMENT); debug(""); - debug("color + depth_stencil"); + debug("color + depth_stencil" + suffix); var texture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, texture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH24_STENCIL8, size, size, 0, gl.DEPTH_STENCIL, gl.UNSIGNED_INT_24_8, null); @@ -209,8 +244,12 @@ function testDepthStencilAttachmentBehaviors() { shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", null); wtu.glErrorShouldBe(gl, gl.NO_ERROR); + if (testOrphanedRenderbuffers) + depthStencilBuffer = createDepthStencilBuffer(); gl.framebufferRenderbuffer( gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + if (testOrphanedRenderbuffers) + orphan(depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); @@ -219,16 +258,24 @@ function testDepthStencilAttachmentBehaviors() { checkBufferBits(gl.DEPTH_STENCIL_ATTACHMENT); debug(""); - debug("DEPTH_STENCIL_ATTACHMENT overwrites DEPTH_ATTACHMENT/STENCIL_ATTACHMENT") + debug("DEPTH_STENCIL_ATTACHMENT overwrites DEPTH_ATTACHMENT/STENCIL_ATTACHMENT" + suffix); + if (testOrphanedRenderbuffers) + depthBuffer = createDepthBuffer(); gl.framebufferRenderbuffer( gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthBuffer); + if (testOrphanedRenderbuffers) + orphan(depthBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", null); wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION); + if (testOrphanedRenderbuffers) + depthStencilBuffer = createDepthStencilBuffer(); gl.framebufferRenderbuffer( gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + if (testOrphanedRenderbuffers) + orphan(depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); @@ -244,9 +291,13 @@ function testDepthStencilAttachmentBehaviors() { checkBufferBits(); debug(""); - debug("STENCIL_ATTACHMENT overwrites stencil set by DEPTH_STENCIL_ATTACHMENT") + debug("STENCIL_ATTACHMENT overwrites stencil set by DEPTH_STENCIL_ATTACHMENT" + suffix); + if (testOrphanedRenderbuffers) + depthStencilBuffer = createDepthStencilBuffer(); gl.framebufferRenderbuffer( gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + if (testOrphanedRenderbuffers) + orphan(depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); @@ -260,6 +311,28 @@ function testDepthStencilAttachmentBehaviors() { wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION); checkFramebuffer([gl.FRAMEBUFFER_COMPLETE]); checkBufferBits(gl.DEPTH_ATTACHMENT); + + debug(""); + debug("DEPTH_ATTACHMENT overwrites depth set by DEPTH_STENCIL_ATTACHMENT" + suffix); + if (testOrphanedRenderbuffers) + depthStencilBuffer = createDepthStencilBuffer(); + gl.framebufferRenderbuffer( + gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + if (testOrphanedRenderbuffers) + orphan(depthStencilBuffer); + shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); + shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); + shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + + gl.framebufferRenderbuffer( + gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, null); + shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", null); + shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", depthStencilBuffer); + shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", null); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION); + checkFramebuffer([gl.FRAMEBUFFER_COMPLETE]); + checkBufferBits(gl.STENCIL_ATTACHMENT); } function testFramebufferIncompleteAttachment() { @@ -469,7 +542,8 @@ description("Test framebuffer object attachment behaviors"); shouldBeNonNull("gl = wtu.create3DContext(undefined, undefined, 2)"); testFramebufferWebGL1RequiredCombinations(); -testDepthStencilAttachmentBehaviors(); +testDepthStencilAttachmentBehaviors(false); +testDepthStencilAttachmentBehaviors(true); testFramebufferIncompleteAttachment(); testFramebufferIncompleteMissingAttachment(); testFramebufferWithImagesOfDifferentSizes(); 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 index 0e435d6a2e..13e5d790e8 100644 --- 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 @@ -121,6 +121,37 @@ function testFramebufferTextureLayer() { "attaching a depth_stencil texture to a framebuffer should succeed."); checkFramebuffer([gl.FRAMEBUFFER_COMPLETE]); + var texDepthStencil = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D_ARRAY, texDepthStencil); + + var texDepthStencilMany = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D_ARRAY, texDepthStencilMany); + var fbDepthStencilMany = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbDepthStencilMany); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, + 0, // level + gl.DEPTH24_STENCIL8, // internalFormat + 1, // width + 1, // height + 2, // depth + 0, // border + gl.DEPTH_STENCIL, // format + gl.UNSIGNED_INT_24_8, // type + new Uint32Array([0, 1])); // data + + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, texDepthStencilMany, 0, 0); + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, texDepthStencilMany, 0, 0); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, + "attaching a depth_stencil 2d array texture level 0 to a framebuffer should succeed."); + checkFramebuffer([gl.FRAMEBUFFER_COMPLETE]); + shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", texDepthStencilMany); + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, texDepthStencilMany, 0, 1); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, + "attaching a 2d array texture level 0 to depth and layer 1 to stencil attachment of a framebuffer should succeed."); + // "Depth and stencil attachments, if present, are the same image." If not, then "FRAMEBUFFER_UNSUPPORTED". + checkFramebuffer([gl.FRAMEBUFFER_UNSUPPORTED]); + shouldEvaluateTo("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", texDepthStencilMany); + // Clean up gl.deleteTexture(tex3d); gl.deleteTexture(texDepthStencil); 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 index 92ce232ee2..c4a1bbe9e8 100644 --- 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 @@ -11,7 +11,6 @@ blitframebuffer-size-overflow.html --min-version 2.0.1 blitframebuffer-stencil-only.html blitframebuffer-test.html --min-version 2.0.1 blitframebuffer-unaffected-by-colormask.html ---min-version 2.0.1 builtin-vert-attribs.html canvas-resizing-with-pbo-bound.html --min-version 2.0.1 clearbuffer-sub-source.html --min-version 2.0.1 clearbufferfv-with-alpha-false.html diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/builtin-vert-attribs.html b/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/builtin-vert-attribs.html deleted file mode 100644 index cc64c9034b..0000000000 --- a/dom/canvas/test/webgl-conf/checkout/conformance2/rendering/builtin-vert-attribs.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - - - - - - - - - -
-
- - - 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 index 17f8312e58..3639c10547 100644 --- 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 @@ -20,6 +20,7 @@ mipmap-fbo.html --min-version 2.0.1 origin-clean-conformance-offscreencanvas.html tex-3d-size-limit.html --min-version 2.0.1 tex-base-level-bug.html +--min-version 2.0.1 tex-image-10bpc.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 diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-10bpc.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-10bpc.html new file mode 100644 index 0000000000..973a0ec0f5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-image-10bpc.html @@ -0,0 +1,66 @@ + + + + + + +Ensure 10bpc image is not crushed to 8bpc in texImage2D + + + + + + +
+
+ + + 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 index f1616e81d7..34ece05699 100644 --- 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 @@ -106,7 +106,6 @@ var tests = [ { type: "video", src: "../../../resources/red-green.mp4", videoType: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"', run: testVideo }, { type: "video", src: "../../../resources/red-green.bt601.vp9.webm", videoType: 'video/webm; codecs="vp9"', run: testVideo }, { type: "video", src: "../../../resources/red-green.webmvp8.webm", videoType: 'video/webm; codecs="vp8, vorbis"', run: testVideo }, - { type: "video", src: "../../../resources/red-green.theora.ogv", videoType: 'video/ogg; codecs="theora, vorbis"', run: testVideo }, ]; var testIndex = 0; 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 index df10edb4d3..760bc6bd19 100644 --- 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 @@ -37,6 +37,7 @@ if (!gl) { testPassed("WebGL context exists"); runTexFormatsTest(); + runDepthStencilFormatTest(); wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors"); } @@ -556,6 +557,35 @@ function runTexFormatsTest() }); } +function runDepthStencilFormatTest() { + debug(""); + debug("Testing FLOAT_32_UNSIGNED_INT_24_8_REV with data"); + const fb = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fb); + + const tex2D = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, tex2D); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH32F_STENCIL8, 1, 1, 0, gl.DEPTH_STENCIL, gl.FLOAT_32_UNSIGNED_INT_24_8_REV, new Uint8Array(8)); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.TEXTURE_2D, tex2D, 0); + if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE) { + testFailed("2D texture with invalid type was created"); + } else { + testPassed("2D texture with invalid type was not created") + } + + const tex3D = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D_ARRAY, tex3D); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.DEPTH32F_STENCIL8, 1, 1, 1, 0, gl.DEPTH_STENCIL, gl.FLOAT_32_UNSIGNED_INT_24_8_REV, new Uint8Array(8)); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION); + gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, tex3D, 0, 0); + if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE) { + testFailed("2D array texture with invalid type was created"); + } else { + testPassed("2D array texture with invalid type was not created") + } +} + debug(""); var successfullyParsed = true; diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/simultaneous_binding.html b/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/simultaneous_binding.html index 228b4ab5cf..11d1eaa829 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/simultaneous_binding.html +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/transform_feedback/simultaneous_binding.html @@ -304,6 +304,17 @@ for (let genericBindPointValue of genericBindPointValues) { gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, 1); wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "copyBufferSubData with double bound buffer"); + debug("
Test that rejected operations do not change the bound buffer size"); + + gl.bindBuffer(gl.ARRAY_BUFFER, tfBuffer); + gl.bufferData(gl.ARRAY_BUFFER, 8, gl.STATIC_DRAW); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "bufferData with double bound buffer"); + + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); + gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Uint8Array(16)); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "bufferSubData should succeed"); + gl.bindBuffer(gl.ARRAY_BUFFER, null); + debug("
Test bufferData family with tf object unbound"); gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); 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 index 20256c6ace..16855453f0 100644 --- 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 @@ -64,6 +64,8 @@ if (!gl) { runUnboundDeleteTest(); runBoundDeleteTest(); runOneOutputFeedbackTest(); + runUnchangedBufferBindingsTest(); + runNoOutputsTest(); // Must be the last test, since it's asynchronous and calls finishTest(). runTwoOutputFeedbackTest(); } @@ -638,6 +640,70 @@ function runContextLostOneOutputFeedbackTest() { finishTest(); } +function runUnchangedBufferBindingsTest() { + debug(""); + debug("Testing that buffer bindings cannot be changed while transform feedback is active"); + + program = wtu.setupTransformFeedbackProgram( + gl, [wtu.simpleVertexShader, wtu.simpleColorFragmentShader], ['gl_Position'], gl.INTERLEAVED_ATTRIBS); + + tf = gl.createTransformFeedback(); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf); + + buf = gl.createBuffer(); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + + gl.beginTransformFeedback(gl.POINTS); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Transform feedback is active"); + + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, gl.createBuffer()); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Cannot change the bound buffer while transform feedback is active"); + shouldBe("gl.getIndexedParameter(gl.TRANSFORM_FEEDBACK_BUFFER_BINDING, 0)", "buf"); + + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Cannot rebind the same buffer while transform feedback is active"); + + gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, 0, gl.createBuffer(), 0, 64); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Cannot change the bound buffer while transform feedback is active"); + shouldBe("gl.getIndexedParameter(gl.TRANSFORM_FEEDBACK_BUFFER_BINDING, 0)", "buf"); + + gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf, 0, 64); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Cannot rebind the same buffer while transform feedback is active"); + + gl.endTransformFeedback(); + gl.deleteTransformFeedback(tf); + gl.deleteBuffer(buf); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No extra errors after the test"); +} + +function runNoOutputsTest() { + debug(""); + debug("Testing transform feedback with no varyings to record"); + + tf = gl.createTransformFeedback(); + gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf); + + buf = gl.createBuffer(); + gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf); + + for (const mode of ['SEPARATE_ATTRIBS', 'INTERLEAVED_ATTRIBS']) { + program = wtu.setupTransformFeedbackProgram( + gl, [wtu.simpleVertexShader, wtu.simpleColorFragmentShader], [], gl[mode]); + + debug(`Testing with ${mode}`); + gl.beginTransformFeedback(gl.POINTS); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "beginTransformFeedback: No varyings to record"); + gl.useProgram(null); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "useProgram: Transform feedback is not active"); + gl.endTransformFeedback(); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "endTransformFeedback: Transform feedback is not active"); + } + + gl.deleteTransformFeedback(tf); + gl.deleteBuffer(buf); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No extra errors after the test"); +} + debug(""); diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/00_test_list.txt new file mode 100644 index 0000000000..d188fc30a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/00_test_list.txt @@ -0,0 +1,12 @@ +--min-version 2.0.1 readpixels-16gb-wasm-memory.html +--min-version 2.0.1 readpixels-4gb-wasm-memory.html +--min-version 2.0.1 teximage2d-16gb-wasm-memory.html +--min-version 2.0.1 teximage2d-4gb-wasm-memory.html +--min-version 2.0.1 texsubimage2d-16gb-wasm-memory.html +--min-version 2.0.1 texsubimage2d-4gb-wasm-memory.html +--min-version 2.0.1 bufferdata-16gb-wasm-memory.html +--min-version 2.0.1 bufferdata-4gb-wasm-memory.html +--min-version 2.0.1 buffersubdata-16gb-wasm-memory.html +--min-version 2.0.1 buffersubdata-4gb-wasm-memory.html +--min-version 2.0.1 getbuffersubdata-16gb-wasm-memory.html +--min-version 2.0.1 getbuffersubdata-4gb-wasm-memory.html \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/bufferdata-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/bufferdata-16gb-wasm-memory.html new file mode 100644 index 0000000000..0dd21bf64f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/bufferdata-16gb-wasm-memory.html @@ -0,0 +1,51 @@ + + + + + +bufferData test to Wasm Memory 16GB in size. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/bufferdata-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/bufferdata-4gb-wasm-memory.html new file mode 100644 index 0000000000..2296c3a5ea --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/bufferdata-4gb-wasm-memory.html @@ -0,0 +1,51 @@ + + + + + +bufferData test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/buffersubdata-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/buffersubdata-16gb-wasm-memory.html new file mode 100644 index 0000000000..08d6d1df50 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/buffersubdata-16gb-wasm-memory.html @@ -0,0 +1,52 @@ + + + + + +bufferSubData test to Wasm Memory 16GB in size. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/buffersubdata-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/buffersubdata-4gb-wasm-memory.html new file mode 100644 index 0000000000..2834a6901b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/buffersubdata-4gb-wasm-memory.html @@ -0,0 +1,52 @@ + + + + + +bufferSubData test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html new file mode 100644 index 0000000000..8390957b02 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html @@ -0,0 +1,48 @@ + + + + + +getBufferSubData test to Wasm Memory 16GB in size. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/getbuffersubdata-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/getbuffersubdata-4gb-wasm-memory.html new file mode 100644 index 0000000000..09a336b753 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/getbuffersubdata-4gb-wasm-memory.html @@ -0,0 +1,48 @@ + + + + + +getBufferSubData test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/readpixels-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/readpixels-16gb-wasm-memory.html new file mode 100644 index 0000000000..af74678dda --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/readpixels-16gb-wasm-memory.html @@ -0,0 +1,51 @@ + + + + + +gl.readPixels() test to Wasm Memory 16GB in size. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/readpixels-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/readpixels-4gb-wasm-memory.html new file mode 100644 index 0000000000..f97a3ccba0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/readpixels-4gb-wasm-memory.html @@ -0,0 +1,50 @@ + + + + + +gl.readPixels() test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/teximage2d-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/teximage2d-16gb-wasm-memory.html new file mode 100644 index 0000000000..8ce5111953 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/teximage2d-16gb-wasm-memory.html @@ -0,0 +1,85 @@ + + + + + +gl.texImage2D() test to Wasm Memory 16GB in size. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/teximage2d-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/teximage2d-4gb-wasm-memory.html new file mode 100644 index 0000000000..5d6897347d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/teximage2d-4gb-wasm-memory.html @@ -0,0 +1,85 @@ + + + + + +gl.texImage2D() test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html new file mode 100644 index 0000000000..328d42ec49 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html @@ -0,0 +1,86 @@ + + + + + +gl.texSubImage2D() test to Wasm Memory 16GB in size. + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/texsubimage2d-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/texsubimage2d-4gb-wasm-memory.html new file mode 100644 index 0000000000..d7756629a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/wasm/texsubimage2d-4gb-wasm-memory.html @@ -0,0 +1,86 @@ + + + + + +gl.texSubImage2D() test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + 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 index ec08eea5ca..55913f4366 100644 --- a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTestCase.js +++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTestCase.js @@ -453,7 +453,32 @@ goog.scope(function() { if (inited) { // Run the test, save the result. + + const debug = tcuTestCase._debug = tcuTestCase._debug || (() => { + function LapStopwatch() { + this.lap = function() { + const now = performance.now(); + const ret = now - this.last; + this.last = now; + return ret; + }; + this.lap(); + } + return { + stopwatch: new LapStopwatch(), + testDoneCount: 0, + }; + })(); + const overheadDur = debug.stopwatch.lap(); + tcuTestCase.lastResult = state.currentTest.iterate(); + + const testDur = debug.stopwatch.lap(); + debug.testDoneCount += 1; + console.log( + `[test ${debug.testDoneCount}] Ran in ${testDur}ms`, + `(+ ${overheadDur}ms overhead)`, + ); } else { // Skip uninitialized test. tcuTestCase.lastResult = tcuTestCase.IterateResult.STOP; @@ -484,8 +509,8 @@ goog.scope(function() { } tcuTestCase.runner.runCallback(tcuTestCase.runTestCases); - } else + } else { tcuTestCase.runner.terminate(); + } }; - }); 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 index 01f56b56c3..d2d6be0e28 100644 --- 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 @@ -27,7 +27,6 @@ function generateTest(pixelFormat, pixelType, prologue) { { 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; 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 index e1cb9f749c..adc1f8a5aa 100644 --- a/dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js +++ b/dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js @@ -93,20 +93,25 @@ const RESULTS = { fail: 0, }; +// We cache these values since they will potentially be accessed many (100k+) +// times and accessing window can be significantly slower than a local variable. +const locationPathname = window.location.pathname; +const webglTestHarness = window.parent.webglTestHarness; + function reportTestResultsToHarness(success, msg) { if (success) { RESULTS.pass += 1; } else { RESULTS.fail += 1; } - if (window.parent.webglTestHarness) { - window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg); + if (webglTestHarness) { + webglTestHarness.reportResults(locationPathname, success, msg); } } function reportSkippedTestResultsToHarness(success, msg) { - if (window.parent.webglTestHarness) { - window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg, true); + if (webglTestHarness) { + webglTestHarness.reportResults(locationPathname, success, msg, true); } } @@ -116,8 +121,8 @@ function notifyFinishedToHarness() { } window._didNotifyFinishedToHarness = true; - if (window.parent.webglTestHarness) { - window.parent.webglTestHarness.notifyFinished(window.location.pathname); + if (webglTestHarness) { + webglTestHarness.notifyFinished(locationPathname); } if (window.nonKhronosFrameworkNotifyDone) { window.nonKhronosFrameworkNotifyDone(); @@ -268,9 +273,9 @@ function getCurrentTestName() */ function testPassedOptions(msg, addSpan) { + reportTestResultsToHarness(true, _currentTestName + ": " + msg); if (addSpan && !quietMode()) { - reportTestResultsToHarness(true, _currentTestName + ": " + msg); _addSpan('PASS ' + escapeHTML(_currentTestName) + ": " + escapeHTML(msg) + ''); } if (_jsTestPreVerboseLogging) { @@ -285,9 +290,9 @@ function testPassedOptions(msg, addSpan) */ function testSkippedOptions(msg, addSpan) { + reportSkippedTestResultsToHarness(true, _currentTestName + ": " + msg); if (addSpan && !quietMode()) { - reportSkippedTestResultsToHarness(true, _currentTestName + ": " + msg); _addSpan('SKIP ' + escapeHTML(_currentTestName) + ": " + escapeHTML(msg) + ''); } if (_jsTestPreVerboseLogging) { diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/compressed-texture-utils.js b/dom/canvas/test/webgl-conf/checkout/js/tests/compressed-texture-utils.js index 46d155f5f1..04396c9b32 100644 --- a/dom/canvas/test/webgl-conf/checkout/js/tests/compressed-texture-utils.js +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/compressed-texture-utils.js @@ -67,6 +67,10 @@ let testCompressedFormatsUnavailableWhenExtensionDisabled = function(gl, compres if (compressedFormats.hasOwnProperty(name)) { gl.compressedTexImage2D(gl.TEXTURE_2D, 0, compressedFormats[name], testSize, testSize, 0, new Uint8Array(expectedByteLength(testSize, testSize, compressedFormats[name]))); wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Trying to use format " + name + " with extension disabled."); + if (gl.texStorage2D) { + gl.texStorage2D(gl.TEXTURE_2D, 1, compressedFormats[name], testSize, testSize); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Trying to use format " + name + " with texStorage2D with extension disabled."); + } } } gl.bindTexture(gl.TEXTURE_2D, null); @@ -255,4 +259,4 @@ return { testTexStorageLevelDimensions: testTexStorageLevelDimensions, }; -})(); \ No newline at end of file +})(); diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/drawingbuffer-storage-test.js b/dom/canvas/test/webgl-conf/checkout/js/tests/drawingbuffer-storage-test.js new file mode 100644 index 0000000000..330171b320 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/drawingbuffer-storage-test.js @@ -0,0 +1,275 @@ +/* +Copyright (c) 2023 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +*/ + +"use strict"; + +let gl; +let oldViewport; +let width; +let height; +let format; +let hasDrawingBufferStorage; +let maxRenderbufferSize; + +function runTest(contextVersion) { + description(); + debug(""); + + function initialize() { + let canvas = document.createElement("canvas"); + gl = wtu.create3DContext(canvas, {antialias: false}); + if (!gl) { + testFailed("context does not exist"); + return [0, 0]; + } + + hasDrawingBufferStorage = `drawingBufferStorage` in gl; + if (!hasDrawingBufferStorage) { + testPassed("drawingBufferStorage not present -- skipping test"); + return; + } + + maxRenderbufferSize = gl.getParameter(gl.MAX_RENDERBUFFER_SIZE); + } + + function testPixel(expected, actual, tol) { + let str = 'approx equal: expected: ' + expected + ', actual: ' + actual + ', tolerance: ' + tol; + for (let i = 0; i < 4; ++i) { + if (Math.abs(expected[i] - actual[i]) > tol) { + testFailed(str); + return; + } + } + testPassed(str); + } + + function srgbToLinear(x) { + if (x < 0.0) + return 0.0; + if (x < 0.04045) + return x / 12.92; + if (x < 1.0) { + return Math.pow((x + 0.055)/1.044, 2.4); + } + return 1.0; + } + + function testClearColor() { + // Make a fresh canvas. + let canvas = document.createElement("canvas"); + canvas.width = 16; + canvas.height = 16; + + gl = wtu.create3DContext(canvas, {antialias: false}); + if (!gl) { + testFailed("context does not exist"); + return; + } + testPassed("context exists"); + shouldBe('gl.drawingBufferFormat', 'gl.RGBA8'); + + let testCase = function(f, size, clearColor, expectedPixel, tolerance) { + format = f; + width = size[0]; + height = size[1]; + + gl.drawingBufferStorage(format, width, height); + shouldBe('gl.getError()', 'gl.NO_ERROR'); + + shouldBe('gl.drawingBufferFormat', 'format'); + shouldBe('gl.drawingBufferWidth', 'width'); + shouldBe('gl.drawingBufferHeight', 'height'); + + gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); + gl.clear(gl.COLOR_BUFFER_BIT); + + let buf; + if (format == 0x881A /*RGBA16F*/) { + buf = new Float32Array(4); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, buf); + } else { + buf = new Uint8Array(4); + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf); + } + testPixel(expectedPixel, buf, tolerance); + } + + debug('Testing RGBA8'); + testCase(gl.RGBA8, [16, 32], + [16 / 255, 32 / 255, 64 / 255, 128 / 255], + [16, 32, 64, 128], + 0); + + // WebGL 1 must use EXT_sRGB for SRGB8_ALPHA8. + let srgb8_alpha8 = gl.SRGB8_ALPHA8; + if (!srgb8_alpha8) { + let ext = gl.getExtension('EXT_sRGB'); + if (ext) { + srgb8_alpha8 = ext.SRGB8_ALPHA8_EXT; + } + } + if (srgb8_alpha8) { + debug('Testing SRGB8_ALPHA8'); + testCase(srgb8_alpha8, [16, 32], + [srgbToLinear(64/255), srgbToLinear(16/255), srgbToLinear(32/255), 128 / 255], + [64, 16, 32, 128], + 1); + } + + if (gl.getExtension('EXT_color_buffer_float')) { + // WebGL 1 must use EXT_color_buffer_half_float for RGBA16F. + let rgba16f = gl.RGBA16F; + if (!rgba16f) { + let ext = gl.getExtension('EXT_color_buffer_half_float'); + if (ext) { + rgba16f = ext.RGBA16F_EXT; + } + } + + debug('Testing RGBA16F'); + testCase(rgba16f, [18, 28], + [0.25, 0.5, 0.75, 0.125], + [0.25, 0.5, 0.75, 0.125], + 0.00001); + } else { + debug('Skipping RGBA16F'); + } + + shouldBe('gl.getError()', 'gl.NO_ERROR'); + } + + function testNoAlpha() { + let canvas = document.createElement("canvas"); + canvas.width = 16; + canvas.height = 16; + gl = wtu.create3DContext(canvas, {alpha:false}); + if (!gl) { + testFailed("context does not exist"); + return; + } + debug('Testing alpha:false'); + + // Report RGB8 for the format. + shouldBe('gl.drawingBufferFormat', 'gl.RGB8'); + + // If WebGLContextAttributes.alpha is false, generate INVALID_OPERATION. + gl.drawingBufferStorage(gl.RGBA8, 16, 16); + shouldBe('gl.getError()', 'gl.INVALID_OPERATION'); + } + + function testMissingExtension() { + let canvas = document.createElement("canvas"); + canvas.width = 16; + canvas.height = 16; + gl = wtu.create3DContext(canvas); + if (!gl) { + testFailed("context does not exist"); + return; + } + + debug('Testing use of RGBA16F without enabling EXT_color_buffer_float'); + gl.drawingBufferStorage(gl.RGBA16F, 16, 16); + shouldBe('gl.getError()', 'gl.INVALID_ENUM'); + } + + function testMaxSize() { + let canvas = document.createElement("canvas"); + canvas.width = 16; + canvas.height = 16; + gl = wtu.create3DContext(canvas); + if (!gl) { + testFailed("context does not exist"); + return; + } + + debug('Testing maximum size'); + gl.drawingBufferStorage(gl.RGBA8, maxRenderbufferSize, maxRenderbufferSize); + shouldBe('gl.getError()', 'gl.NONE'); + shouldBe('gl.drawingBufferWidth', 'maxRenderbufferSize'); + shouldBe('gl.drawingBufferHeight', 'maxRenderbufferSize'); + + debug('Testing over-maximum width and ehgith'); + gl.drawingBufferStorage(gl.RGBA8, maxRenderbufferSize+1, 16); + shouldBe('gl.getError()', 'gl.INVALID_VALUE'); + gl.drawingBufferStorage(gl.RGBA8, 16, maxRenderbufferSize+1); + shouldBe('gl.getError()', 'gl.INVALID_VALUE'); + shouldBe('gl.drawingBufferWidth', 'maxRenderbufferSize'); + shouldBe('gl.drawingBufferHeight', 'maxRenderbufferSize'); + } + + function testDrawToCanvas() { + let canvasGL = document.createElement("canvas"); + canvasGL.width = 16; + canvasGL.height = 16; + gl = wtu.create3DContext(canvasGL); + if (!gl) { + testFailed("context does not exist"); + return; + } + + let canvas2D = document.createElement("canvas"); + canvas2D.width = 16; + canvas2D.height = 16; + let ctx = canvas2D.getContext('2d'); + let imageData = new ImageData(16, 16); + + let testCase = function(f, clearColor, canvasColor, tolerance) { + gl.drawingBufferStorage(f, 16, 16); + gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); + gl.clear(gl.COLOR_BUFFER_BIT); + + ctx.putImageData(imageData, 0, 0); + ctx.drawImage(canvasGL, 0, 0); + testPixel(canvasColor, ctx.getImageData(8, 8, 1, 1).data, tolerance); + } + + debug('Drawing RGBA to canvas'); + testCase(gl.RGBA8, [16/255, 32/255, 64/255, 64/255], [64, 128, 255, 64], 0); + + // WebGL 1 must use EXT_sRGB for SRGB8_ALPHA8. + let srgb8_alpha8 = gl.SRGB8_ALPHA8; + if (!srgb8_alpha8) { + let ext = gl.getExtension('EXT_sRGB'); + if (ext) { + srgb8_alpha8 = ext.SRGB8_ALPHA8_EXT; + } + } + if (srgb8_alpha8) { + debug('Drawing opaque SRGB8_ALPHA8 to canvas'); + testCase(srgb8_alpha8, + [srgbToLinear(64/255), srgbToLinear(32/255), srgbToLinear(16/255), 1.0], + [64, 32, 16, 255], + 1); + + debug('Drawing transparent SRGB8_ALPHA8 to canvas'); + // We set the tolerance to 5 because of compounding error. The backbuffer + // may be off by 1, and then un-premultiplying alpha of 64/55 will multiply + // that error by 4. Then add one to be safe. + testCase(srgb8_alpha8, + [srgbToLinear(32/255), srgbToLinear(64/255), srgbToLinear(16/255), 64/255], + [128, 255, 64, 64], + 5); + } + + if (gl.getExtension('EXT_color_buffer_float')) { + debug('Drawing transparent RGBA16F to canvas'); + testCase(gl.RGBA16F, + [32/255, 64/255, 16/255, 64/255], + [128, 255, 64, 64], + 1); + } + } + + let wtu = WebGLTestUtils; + initialize(); + if (hasDrawingBufferStorage) { + testClearColor(); + testNoAlpha(); + testMissingExtension(); + testMaxSize(); + testDrawToCanvas(); + } +} diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/ext-color-buffer-half-float.js b/dom/canvas/test/webgl-conf/checkout/js/tests/ext-color-buffer-half-float.js index 51509e8a6e..2975ec0fe4 100644 --- a/dom/canvas/test/webgl-conf/checkout/js/tests/ext-color-buffer-half-float.js +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/ext-color-buffer-half-float.js @@ -422,6 +422,33 @@ if (!gl) { runRGB16FNegativeTest(); } + if (version == 1) { + debug(""); + debug("Testing that component type framebuffer attachment queries are rejected with the extension disabled"); + const fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + const rbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,gl.RENDERBUFFER, rbo); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB565, 8, 8); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Setup renderbuffer should succeed."); + shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0x8211 /* FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */)'); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Query must fail."); + gl.deleteRenderbuffer(rbo); + + const tex = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 8, 8, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Setup texture should succeed."); + shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0x8211 /* FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */)'); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Query must fail."); + gl.deleteTexture(tex); + + gl.deleteFramebuffer(fbo); + } + let oesTextureHalfFloat = null; if (version == 1) { // oesTextureHalfFloat implicitly enables EXT_color_buffer_half_float if supported @@ -466,6 +493,47 @@ if (!gl) { runCopyTexImageTest(true); runUniqueObjectTest(); + + { + debug(""); + debug("Testing that component type framebuffer attachment queries are accepted with the extension enabled"); + const fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + + const rbo = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rbo); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,gl.RENDERBUFFER, rbo); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB565, 8, 8); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)', 'ext.UNSIGNED_NORMALIZED_EXT'); + gl.renderbufferStorage(gl.RENDERBUFFER, ext.RGBA16F_EXT, 8, 8); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)', 'gl.FLOAT'); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No errors after valid renderbuffer attachment queries."); + + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT,gl.RENDERBUFFER, rbo); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, 8, 8); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No errors after depth-stencil renderbuffer setup."); + shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)'); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Component type query is not allowed for combined depth-stencil attachments."); + gl.deleteRenderbuffer(rbo); + + const tex = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 8, 8, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)', 'ext.UNSIGNED_NORMALIZED_EXT'); + const tex_ext = gl.getExtension("OES_texture_half_float"); + if (version > 1 || tex_ext) { + if (version > 1) + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA16F, 8, 8, 0, gl.RGBA, gl.HALF_FLOAT, null); + else + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 8, 8, 0, gl.RGBA, tex_ext.HALF_FLOAT_OES, null); + shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)', 'gl.FLOAT'); + } + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No errors after valid texture attachment queries."); + gl.deleteTexture(tex); + + gl.deleteFramebuffer(fbo); + } } } 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 index 14cf4628be..504b70564e 100644 --- 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 @@ -14,7 +14,6 @@ function generateTest(internalFormat, pixelFormat, pixelType, prologue, resource { 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.bt601.vp9.webm", type: 'video/webm; codecs="vp9"', }, - { src: resourcePath + "red-green.theora.ogv" , type: 'video/ogg; codecs="theora, vorbis"', }, ]; function 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 index 6e8bcf96e9..8dadde2d69 100644 --- 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 @@ -27,7 +27,6 @@ function generateTest(internalFormat, pixelFormat, pixelType, prologue, resource { 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.bt601.vp9.webm", type: 'video/webm; codecs="vp9"', }, - { src: resourcePath + "red-green.theora.ogv" , type: 'video/ogg; codecs="theora, vorbis"', }, ]; function 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 index a268f7d8d5..b1dbd33913 100644 --- 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 @@ -14,7 +14,6 @@ function generateTest(internalFormat, pixelFormat, pixelType, prologue, resource { 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.bt601.vp9.webm", type: 'video/webm; codecs="vp9"', }, - { src: resourcePath + "red-green.theora.ogv" , type: 'video/ogg; codecs="theora, vorbis"', }, ]; function 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 index 0c2c40e8a5..43ad660070 100644 --- 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 @@ -29,7 +29,6 @@ function generateTest(internalFormat, pixelFormat, pixelType, prologue, resource { src: resourcePath + "red-green.mp4" , type: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"', }, { src: resourcePath + "red-green.bt601.vp9.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() diff --git a/dom/canvas/test/webgl-conf/checkout/js/tests/webgl-blend-func-extended.js b/dom/canvas/test/webgl-conf/checkout/js/tests/webgl-blend-func-extended.js new file mode 100644 index 0000000000..086d9cfb16 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/js/tests/webgl-blend-func-extended.js @@ -0,0 +1,548 @@ +"use strict"; +description("This test verifies the functionality of the WEBGL_blend_func_extended extension, if it is available."); + +debug(""); + +var wtu = WebGLTestUtils; +var gl = wtu.create3DContext("c", undefined, contextVersion); +var ext; + +function runTestNoExtension() { + debug(""); + debug("Testing getParameter without the extension"); + shouldBeNull("gl.getParameter(0x88FC /* MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL */)"); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "parameter unknown"); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + + if (contextVersion == 1) { + debug(""); + debug("Testing SRC_ALPHA_SATURATE without the extension"); + + gl.blendFunc(gl.ONE, gl.SRC_ALPHA_SATURATE); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "SRC_ALPHA_SATURATE not accepted as blendFunc dfactor"); + gl.blendFuncSeparate(gl.ONE, gl.SRC_ALPHA_SATURATE, gl.ONE, gl.ONE); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "SRC_ALPHA_SATURATE not accepted as blendFuncSeparate dstRGB"); + gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.SRC_ALPHA_SATURATE); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "SRC_ALPHA_SATURATE not accepted as blendFuncSeparate dstAlpha"); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + } + + debug(""); + debug("Testing SRC1 blend funcs without the extension"); + + const extFuncs = { + SRC1_COLOR_WEBGL: 0x88F9, + SRC1_ALPHA_WEBGL: 0x8589, + ONE_MINUS_SRC1_COLOR_WEBGL: 0x88FA, + ONE_MINUS_SRC1_ALPHA_WEBGL: 0x88FB + }; + + for (const func in extFuncs) { + gl.blendFunc(extFuncs[func], gl.ONE); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFunc sfactor`); + gl.blendFunc(gl.ONE, extFuncs[func]); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFunc dfactor`); + gl.blendFuncSeparate(extFuncs[func], gl.ONE, gl.ONE, gl.ONE); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFuncSeparate srcRGB`); + gl.blendFuncSeparate(gl.ONE, extFuncs[func], gl.ONE, gl.ONE); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFuncSeparate dstRGB`); + gl.blendFuncSeparate(gl.ONE, gl.ONE, extFuncs[func], gl.ONE); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFuncSeparate srcAlpha`); + gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, extFuncs[func]); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFuncSeparate dstAlpha`); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + } + + const dbi = gl.getExtension("OES_draw_buffers_indexed"); + if (!dbi) return; + + debug(""); + debug("Testing indexed SRC1 blend funcs without the extension"); + for (const func in extFuncs) { + dbi.blendFunciOES(0, extFuncs[func], gl.ONE); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFunciOES src`); + dbi.blendFunciOES(0, gl.ONE, extFuncs[func]); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFunciOES dst`); + dbi.blendFuncSeparateiOES(0, extFuncs[func], gl.ONE, gl.ONE, gl.ONE); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFuncSeparateiOES srcRGB`); + dbi.blendFuncSeparateiOES(0, gl.ONE, extFuncs[func], gl.ONE, gl.ONE); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFuncSeparateiOES dstRGB`); + dbi.blendFuncSeparateiOES(0, gl.ONE, gl.ONE, extFuncs[func], gl.ONE); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFuncSeparateiOES srcAlpha`); + dbi.blendFuncSeparateiOES(0, gl.ONE, gl.ONE, gl.ONE, extFuncs[func]); + wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, `${func} not accepted as blendFuncSeparateiOES dstAlpha`); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + } +} + +function runEnumTests() { + debug(""); + debug("Testing enums"); + shouldBe("ext.SRC1_COLOR_WEBGL", "0x88F9"); + shouldBe("ext.SRC1_ALPHA_WEBGL", "0x8589"); + shouldBe("ext.ONE_MINUS_SRC1_COLOR_WEBGL", "0x88FA"); + shouldBe("ext.ONE_MINUS_SRC1_ALPHA_WEBGL", "0x88FB"); + shouldBe("ext.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL", "0x88FC"); +} + +function runQueryTests() { + debug(""); + debug("Testing getParameter"); + shouldBeGreaterThanOrEqual("gl.getParameter(ext.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL)", "1"); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + + if (contextVersion == 1) { + debug(""); + debug("Testing SRC_ALPHA_SATURATE with the extension"); + + gl.blendFunc(gl.ONE, gl.SRC_ALPHA_SATURATE); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "SRC_ALPHA_SATURATE accepted as blendFunc dfactor"); + shouldBe("gl.getParameter(gl.BLEND_DST_RGB)", "gl.SRC_ALPHA_SATURATE"); + shouldBe("gl.getParameter(gl.BLEND_DST_ALPHA)", "gl.SRC_ALPHA_SATURATE"); + gl.blendFuncSeparate(gl.ONE, gl.SRC_ALPHA_SATURATE, gl.ONE, gl.ONE); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "SRC_ALPHA_SATURATE accepted as blendFuncSeparate dstRGB"); + shouldBe("gl.getParameter(gl.BLEND_DST_RGB)", "gl.SRC_ALPHA_SATURATE"); + gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.SRC_ALPHA_SATURATE); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "SRC_ALPHA_SATURATE accepted as blendFuncSeparate dstAlpha"); + shouldBe("gl.getParameter(gl.BLEND_DST_ALPHA)", "gl.SRC_ALPHA_SATURATE"); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + } + + const extFuncs = [ + "SRC1_COLOR_WEBGL", + "SRC1_ALPHA_WEBGL", + "ONE_MINUS_SRC1_COLOR_WEBGL", + "ONE_MINUS_SRC1_ALPHA_WEBGL" + ]; + + debug(""); + debug("Testing blend state updates with SRC1 blend funcs"); + for (const func of extFuncs) { + gl.blendFunc(ext[func], gl.ONE); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} accepted as blendFunc sfactor`); + shouldBe("gl.getParameter(gl.BLEND_SRC_RGB)", `ext.${func}`); + shouldBe("gl.getParameter(gl.BLEND_SRC_ALPHA)", `ext.${func}`); + gl.blendFunc(gl.ONE, ext[func]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} accepted as blendFunc dfactor`); + shouldBe("gl.getParameter(gl.BLEND_DST_RGB)", `ext.${func}`); + shouldBe("gl.getParameter(gl.BLEND_DST_ALPHA)", `ext.${func}`); + gl.blendFuncSeparate(ext[func], gl.ONE, gl.ONE, gl.ONE); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} accepted as blendFuncSeparate srcRGB`); + shouldBe("gl.getParameter(gl.BLEND_SRC_RGB)", `ext.${func}`); + gl.blendFuncSeparate(gl.ONE, ext[func], gl.ONE, gl.ONE); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} accepted as blendFuncSeparate dstRGB`); + shouldBe("gl.getParameter(gl.BLEND_DST_RGB)", `ext.${func}`); + gl.blendFuncSeparate(gl.ONE, gl.ONE, ext[func], gl.ONE); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} accepted as blendFuncSeparate srcAlpha`); + shouldBe("gl.getParameter(gl.BLEND_SRC_ALPHA)", `ext.${func}`); + gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, ext[func]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} accepted as blendFuncSeparate dstAlpha`); + shouldBe("gl.getParameter(gl.BLEND_DST_ALPHA)", `ext.${func}`); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + } + + const dbi = gl.getExtension("OES_draw_buffers_indexed"); + if (!dbi) return; + + debug(""); + debug("Testing indexed blend state updates with SRC1 blend funcs"); + for (const func of extFuncs) { + dbi.blendFunciOES(0, ext[func], gl.ONE); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} accepted as blendFunciOES src`); + shouldBe("gl.getIndexedParameter(gl.BLEND_SRC_RGB, 0)", `ext.${func}`); + shouldBe("gl.getIndexedParameter(gl.BLEND_SRC_ALPHA, 0)", `ext.${func}`); + dbi.blendFunciOES(0, gl.ONE, ext[func]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} accepted as blendFunciOES dst`); + shouldBe("gl.getIndexedParameter(gl.BLEND_DST_RGB, 0)", `ext.${func}`); + shouldBe("gl.getIndexedParameter(gl.BLEND_DST_ALPHA, 0)", `ext.${func}`); + dbi.blendFuncSeparateiOES(0, ext[func], gl.ONE, gl.ONE, gl.ONE); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} not accepted as blendFuncSeparateiOES srcRGB`); + shouldBe("gl.getIndexedParameter(gl.BLEND_SRC_RGB, 0)", `ext.${func}`); + dbi.blendFuncSeparateiOES(0, gl.ONE, ext[func], gl.ONE, gl.ONE); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} not accepted as blendFuncSeparateiOES dstRGB`); + shouldBe("gl.getIndexedParameter(gl.BLEND_DST_RGB, 0)", `ext.${func}`); + dbi.blendFuncSeparateiOES(0, gl.ONE, gl.ONE, ext[func], gl.ONE); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} not accepted as blendFuncSeparateiOES srcAlpha`); + shouldBe("gl.getIndexedParameter(gl.BLEND_SRC_ALPHA, 0)", `ext.${func}`); + dbi.blendFuncSeparateiOES(0, gl.ONE, gl.ONE, gl.ONE, ext[func]); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, `${func} not accepted as blendFuncSeparateiOES dstAlpha`); + shouldBe("gl.getIndexedParameter(gl.BLEND_DST_ALPHA, 0)", `ext.${func}`); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + } +} + +function runShaderTests(extensionEnabled) { + debug(""); + debug("Testing various shader compiles with extension " + (extensionEnabled ? "enabled" : "disabled")); + + const shaderSets = []; + + const macro100 = `precision mediump float; + void main() { + #ifdef GL_EXT_blend_func_extended + gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); + #else + #error no GL_EXT_blend_func_extended; + #endif + }`; + const macro300 = `#version 300 es + out mediump vec4 my_FragColor; + void main() { + #ifdef GL_EXT_blend_func_extended + my_FragColor = vec4(1.0, 0.0, 0.0, 1.0); + #else + #error no GL_EXT_blend_func_extended; + #endif + }`; + shaderSets.push([wtu.simpleVertexShader, macro100]); + if (contextVersion == 2) { + shaderSets.push([wtu.simpleVertexShaderESSL300, macro300]); + } + + for (const shaders of shaderSets) { + // Expect the macro shader to succeed ONLY if enabled + if (wtu.setupProgram(gl, shaders)) { + if (extensionEnabled) { + testPassed("Macro defined in shaders when extension is enabled"); + } else { + testFailed("Macro defined in shaders when extension is disabled"); + } + } else { + if (extensionEnabled) { + testFailed("Macro not defined in shaders when extension is enabled"); + } else { + testPassed("Macro not defined in shaders when extension is disabled"); + } + } + } + + shaderSets.length = 0; + + const missing100 = ` + void main() { + gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); + gl_SecondaryFragColorEXT = vec4(0.0, 1.0, 0.0, 1.0); + }`; + shaderSets.push([wtu.simpleVertexShader, missing100]); + + const missing300 = `#version 300 es + layout(location = 0) out mediump vec4 oColor0; + layout(location = 0, index = 1) out mediump vec4 oColor1; + void main() { + oColor0 = vec4(1.0, 0.0, 0.0, 1.0); + oColor1 = vec4(0.0, 1.0, 0.0, 1.0); + }`; + if (contextVersion == 2) { + shaderSets.push([wtu.simpleVertexShaderESSL300, missing300]); + } + + // Always expect the shader missing the #extension pragma to fail (whether enabled or not) + for (const shaders of shaderSets) { + if (wtu.setupProgram(gl, shaders)) { + testFailed("Secondary fragment output allowed without #extension pragma"); + } else { + testPassed("Secondary fragment output disallowed without #extension pragma"); + } + } + + shaderSets.length = 0; + + const valid100 = `#extension GL_EXT_blend_func_extended : enable + void main() { + gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); + gl_SecondaryFragColorEXT = vec4(0.0, 1.0, 0.0, 1.0); + }`; + shaderSets.push([wtu.simpleVertexShader, valid100]); + + const valid300 = `#version 300 es + #extension GL_EXT_blend_func_extended : enable + layout(location = 0) out mediump vec4 oColor0; + layout(location = 0, index = 1) out mediump vec4 oColor1; + void main() { + oColor0 = vec4(1.0, 0.0, 0.0, 1.0); + oColor1 = vec4(0.0, 1.0, 0.0, 1.0); + }`; + if (contextVersion == 2) { + shaderSets.push([wtu.simpleVertexShaderESSL300, valid300]); + } + + // Try to compile a shader using a secondary fragment output that should only succeed if enabled + for (const shaders of shaderSets) { + if (wtu.setupProgram(gl, shaders)) { + if (extensionEnabled) { + testPassed("Secondary fragment output compiled successfully when extension enabled"); + } else { + testFailed("Secondary fragment output compiled successfully when extension disabled"); + } + } else { + if (extensionEnabled) { + testFailed("Secondary fragment output failed to compile when extension enabled"); + } else { + testPassed("Secondary fragment output failed to compile when extension disabled"); + } + } + } + + // ESSL 3.00: Testing that multiple outputs require explicit locations + if (contextVersion == 2) { + const locations300 = `#version 300 es + #extension GL_EXT_blend_func_extended : enable + out mediump vec4 color0; + out mediump vec4 color1; + void main() { + color0 = vec4(1.0, 0.0, 0.0, 1.0); + color1 = vec4(0.0, 1.0, 0.0, 1.0); + }`; + if (wtu.setupProgram(gl, [wtu.simpleVertexShaderESSL300, locations300])) { + testFailed("Multiple fragment outputs compiled successfully without explicit locations"); + } else { + testPassed("Multiple fragment outputs failed to compile without explicit locations"); + } + } +} + +function runMissingOutputsTests() { + debug(""); + debug("Test draw calls with missing fragment outputs"); + + wtu.setupUnitQuad(gl); + gl.blendFunc(gl.ONE, ext.SRC1_COLOR_WEBGL); + + for (const enabled of [false, true]) { + if (enabled) { + gl.enable(gl.BLEND); + } else { + gl.disable(gl.BLEND); + } + + for (const maskedOut of [false, true]) { + gl.colorMask(!maskedOut, false, false, false); + + const label = `Dual-source blending ${enabled ? "ENABLED" : "DISABLED"}, ` + + `missing fragment outputs, and ` + + `${maskedOut ? "" : "NOT "}all color channels masked out`; + debug(`ESSL 1.00: ${label}`); + + { + const none = "void main() {}"; + wtu.setupProgram(gl, [wtu.simpleVertexShader, none]); + wtu.drawUnitQuad(gl); + wtu.glErrorShouldBe(gl, maskedOut ? gl.NO_ERROR : gl.INVALID_OPERATION, + "no fragment outputs"); + } + + { + const fragColor = ` + void main() { + gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); + }`; + wtu.setupProgram(gl, [wtu.simpleVertexShader, fragColor]); + wtu.drawUnitQuad(gl); + wtu.glErrorShouldBe(gl, (!enabled || maskedOut) ? gl.NO_ERROR : gl.INVALID_OPERATION, + "only gl_FragColor"); + } + + { + const secondaryFragColor = `#extension GL_EXT_blend_func_extended : enable + void main() { + gl_SecondaryFragColorEXT = vec4(0.0, 1.0, 0.0, 1.0); + }`; + wtu.setupProgram(gl, [wtu.simpleVertexShader, secondaryFragColor]); + wtu.drawUnitQuad(gl); + wtu.glErrorShouldBe(gl, maskedOut ? gl.NO_ERROR : gl.INVALID_OPERATION, + "only gl_SecondaryFragColorEXT"); + } + + if (contextVersion == 1) continue; + + debug(`ESSL 3.00: ${label}`); + + { + const none = `#version 300 es + void main() {}`; + wtu.setupProgram(gl, [wtu.simpleVertexShaderESSL300, none]); + wtu.drawUnitQuad(gl); + wtu.glErrorShouldBe(gl, maskedOut ? gl.NO_ERROR : gl.INVALID_OPERATION, + "no fragment outputs"); + } + + { + const color0 = `#version 300 es + out mediump vec4 color0; + void main() { + color0 = vec4(1.0, 0.0, 0.0, 1.0); + }`; + wtu.setupProgram(gl, [wtu.simpleVertexShaderESSL300, color0]); + wtu.drawUnitQuad(gl); + wtu.glErrorShouldBe(gl, (!enabled || maskedOut) ? gl.NO_ERROR : gl.INVALID_OPERATION, + "only index 0 output"); + } + + { + const color1 = `#version 300 es + #extension GL_EXT_blend_func_extended : enable + layout(location = 0, index = 1) out mediump vec4 color1; + void main() { + color1 = vec4(0.0, 1.0, 0.0, 1.0); + }`; + wtu.setupProgram(gl, [wtu.simpleVertexShaderESSL300, color1]); + wtu.drawUnitQuad(gl); + wtu.glErrorShouldBe(gl, maskedOut ? gl.NO_ERROR : gl.INVALID_OPERATION, + "only index 1 output"); + } + } + } + gl.colorMask(true, true, true, true); +} + +function runDrawBuffersLimitTests() { + const dbi = gl.getExtension("OES_draw_buffers_indexed"); + if (!dbi) return; + + debug(""); + debug("Testing that dual-source blending limits the number of active draw buffers"); + + const rb0 = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rb0); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 1, 1); + + const rb1 = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, rb1); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 1, 1); + + gl.bindRenderbuffer(gl.RENDERBUFFER, null); + + const fbo = gl.createFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rb0); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT1, gl.RENDERBUFFER, rb1); + wtu.framebufferStatusShouldBe(gl, gl.FRAMEBUFFER, gl.FRAMEBUFFER_COMPLETE); + + const fs = `#version 300 es + #extension GL_EXT_blend_func_extended : enable + layout(location = 0, index = 0) out mediump vec4 color0; + layout(location = 0, index = 1) out mediump vec4 color1; + void main() { + color0 = vec4(1.0, 0.0, 0.0, 1.0); + color1 = vec4(0.0, 1.0, 0.0, 1.0); + }`; + wtu.setupProgram(gl, [wtu.simpleVertexShaderESSL300, fs]); + + wtu.setupUnitQuad(gl); + + // Enable both draw buffers + gl.drawBuffers([gl.COLOR_ATTACHMENT0, gl.COLOR_ATTACHMENT1]); + + // Mask out draw buffer 1 to pass missing fragment outputs check + dbi.colorMaskiOES(1, false, false, false, false); + + const extFuncs = [ + "SRC1_COLOR_WEBGL", + "SRC1_ALPHA_WEBGL", + "ONE_MINUS_SRC1_COLOR_WEBGL", + "ONE_MINUS_SRC1_ALPHA_WEBGL" + ]; + + for (const func of extFuncs) { + for (let slot = 0; slot < 4; slot++) { + let param; + switch (slot) { + case 0: + param = "srcRGB"; + gl.blendFuncSeparate(ext[func], gl.ONE, gl.ONE, gl.ONE); + break; + case 1: + param = "dstRGB"; + gl.blendFuncSeparate(gl.ONE, ext[func], gl.ONE, gl.ONE); + break; + case 2: + param = "srcAlpha"; + gl.blendFuncSeparate(gl.ONE, gl.ONE, ext[func], gl.ONE); + break; + case 3: + param = "dstAlpha"; + gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, ext[func]); + break; + } + debug(`Testing ${func} with ${param}`); + + // Limit must be applied even with blending disabled + gl.disable(gl.BLEND); + wtu.drawUnitQuad(gl); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "blending disabled"); + + gl.enable(gl.BLEND); + wtu.drawUnitQuad(gl); + wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "blending enabled"); + + // Limit is not applied when non-SRC1 funcs are used + gl.blendFunc(gl.ONE, gl.ONE); + wtu.drawUnitQuad(gl); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "dual-source blending disabled"); + } + } + gl.bindFramebuffer(gl.FRAMEBUFFER, null); +} + +function runBlendingTests() { + debug(""); + debug("Testing rendering with two most common dual-source blending configurations"); + + const fs = `#extension GL_EXT_blend_func_extended : enable + uniform mediump vec4 u_src0; + uniform mediump vec4 u_src1; + void main() { + gl_FragColor = u_src0; + gl_SecondaryFragColorEXT = u_src1; + }`; + const program = wtu.setupProgram(gl, [wtu.simpleVertexShader, fs]); + const uSrc0 = gl.getUniformLocation(program, "u_src0"); + const uSrc1 = gl.getUniformLocation(program, "u_src1"); + + gl.enable(gl.BLEND); + wtu.setupUnitQuad(gl); + gl.clearColor(1.0, 1.0, 1.0, 1.0); + + gl.clear(gl.COLOR_BUFFER_BIT); + gl.blendFunc(gl.ONE, ext.SRC1_COLOR_WEBGL); + gl.uniform4f(uSrc0, 0.250, 0.375, 0.500, 0.625); + gl.uniform4f(uSrc1, 0.125, 0.125, 0.125, 0.125); + wtu.drawUnitQuad(gl); + wtu.checkCanvas(gl, [96, 128, 159, 191], "Multiply destination by SRC1 and add SRC0", 2); + + gl.clear(gl.COLOR_BUFFER_BIT); + gl.blendFunc(ext.SRC1_COLOR_WEBGL, ext.ONE_MINUS_SRC1_COLOR_WEBGL); + gl.uniform4f(uSrc0, 0.125, 0.125, 0.125, 0.125); + gl.uniform4f(uSrc1, 0.500, 0.375, 0.250, 0.125); + wtu.drawUnitQuad(gl); + wtu.checkCanvas(gl, [143, 171, 199, 227], "Per-channel color interpolation using SRC1", 2); +} + +function runTest() { + if (!gl) { + testFailed("context does not exist"); + return; + } + testPassed("context exists"); + + runTestNoExtension(); + runShaderTests(false); + + ext = gl.getExtension("WEBGL_blend_func_extended"); + wtu.runExtensionSupportedTest(gl, "WEBGL_blend_func_extended", ext !== null); + + if (ext !== null) { + runEnumTests(); + runQueryTests(); + runShaderTests(true); + runMissingOutputsTests(); + runDrawBuffersLimitTests(); + runBlendingTests(); + } else { + testPassed("No WEBGL_blend_func_extended support -- this is legal"); + } +} + +runTest(); + +var successfullyParsed = true; 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 index f48d9d2ad7..ca6cbfcd36 100644 --- a/dom/canvas/test/webgl-conf/checkout/js/webgl-test-harness.js +++ b/dom/canvas/test/webgl-conf/checkout/js/webgl-test-harness.js @@ -538,15 +538,36 @@ TestHarness.prototype.runTests = function(opt_options) { this.startNextTest(); }; -TestHarness.prototype.setTimeout = function(test) { - var that = this; - test.timeoutId = this.window.setTimeout(function() { - that.timeout(test); - }, this.timeoutDelay); +TestHarness.prototype._bumpTimeout = function(test) { + const newTimeoutAt = performance.now() + this.timeoutDelay; + if (test.timeoutAt) { + test.timeoutAt = newTimeoutAt; + return; + } + test.timeoutAt = newTimeoutAt; + + const harness = this; + + function enqueueWatchdog() { + const remaining = test.timeoutAt - performance.now(); + //console.log(`watchdog started at ${performance.now()}, ${test.timeoutAt} requested`); + this.window.setTimeout(() => { + if (!test.timeoutAt) return; // Timeout was cleared. + const remainingAtCheckTime = test.timeoutAt - performance.now(); + if (performance.now() >= test.timeoutAt) { + //console.log(`watchdog won at ${performance.now()}, ${test.timeoutAt} requested`); + harness.timeout(test); + return; + } + //console.log(`watchdog lost at ${performance.now()}, as ${test.timeoutAt} is now requested`); + enqueueWatchdog(); + }, remaining); + } + enqueueWatchdog(); }; TestHarness.prototype.clearTimeout = function(test) { - this.window.clearTimeout(test.timeoutId); + test.timeoutAt = null; }; TestHarness.prototype.startNextTest = function() { @@ -577,7 +598,7 @@ TestHarness.prototype.startTest = function(iframe, testFile, webglVersion) { "dumpShaders": this.dumpShaders, "quiet": this.quiet }); - this.setTimeout(test); + this._bumpTimeout(test); } else { this.reportResults(url, !!this.allowSkip, "skipped", true); this.notifyFinished(url); @@ -595,11 +616,15 @@ TestHarness.prototype.getTest = function(url) { TestHarness.prototype.reportResults = function(url, success, msg, skipped) { url = FilterURL(url); var test = this.getTest(url); - this.clearTimeout(test); - log((success ? "PASS" : "FAIL") + ": " + msg); + if (0) { + // This is too slow to leave on for tests like + // deqp/functional/gles3/vertexarrays/multiple_attributes.output.html + // which has 33013505 calls to reportResults. + 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); + this._bumpTimeout(test); }; TestHarness.prototype.dequeTest = function(test) { diff --git a/dom/canvas/test/webgl-conf/checkout/py/lint/lint.allowlist b/dom/canvas/test/webgl-conf/checkout/py/lint/lint.allowlist index eb4efce09e..b610bfa4e1 100644 --- a/dom/canvas/test/webgl-conf/checkout/py/lint/lint.allowlist +++ b/dom/canvas/test/webgl-conf/checkout/py/lint/lint.allowlist @@ -21,7 +21,7 @@ UNNECESSARY EXECUTABLE PERMISSION:specs/1.0 UNNECESSARY EXECUTABLE PERMISSION:specs/2.0 ## Ignore INDENT TABS ## - + INDENT TABS:*.frag INDENT TABS:*.vert #The original dEQP tests used tabs throughout. @@ -46,7 +46,6 @@ INVALID UNICODE:conformance/glsl/misc/non-ascii.vert.html *:*.mp3 *:*.m4a *:*.oga -*:*.ogv *:*.webm *:*.mp4 *:*.m4v diff --git a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-6-90-ccw.jpg b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-6-90-ccw.jpg deleted file mode 100644 index b4679aedd9..0000000000 Binary files a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-6-90-ccw.jpg and /dev/null differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-6-90-cw.jpg b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-6-90-cw.jpg new file mode 100644 index 0000000000..d4e75fac7d Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-6-90-cw.jpg differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-8-90-ccw.jpg b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-8-90-ccw.jpg new file mode 100644 index 0000000000..b4679aedd9 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-8-90-ccw.jpg differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-8-90-cw.jpg b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-8-90-cw.jpg deleted file mode 100644 index d4e75fac7d..0000000000 Binary files a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-originals/exif-orientation-test-8-90-cw.jpg and /dev/null differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-6-90-ccw.jpg b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-6-90-ccw.jpg deleted file mode 100644 index f8c9a6b0cc..0000000000 Binary files a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-6-90-ccw.jpg and /dev/null differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-6-90-cw.jpg b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-6-90-cw.jpg new file mode 100644 index 0000000000..f8c9a6b0cc Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-6-90-cw.jpg differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-8-90-ccw.jpg b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-8-90-ccw.jpg new file mode 100644 index 0000000000..594c86ff4e Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-8-90-ccw.jpg differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-8-90-cw.jpg b/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-8-90-cw.jpg deleted file mode 100644 index 594c86ff4e..0000000000 Binary files a/dom/canvas/test/webgl-conf/checkout/resources/exif-orientation-test-8-90-cw.jpg and /dev/null 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 deleted file mode 100644 index 4458678fbf..0000000000 Binary files a/dom/canvas/test/webgl-conf/checkout/resources/npot-video.theora.ogv and /dev/null differ diff --git a/dom/canvas/test/webgl-conf/checkout/resources/red-gradient-8x1-10bit-untagged.png b/dom/canvas/test/webgl-conf/checkout/resources/red-gradient-8x1-10bit-untagged.png new file mode 100644 index 0000000000..d01209e9b5 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/resources/red-gradient-8x1-10bit-untagged.png differ 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 deleted file mode 100644 index 1543915a10..0000000000 Binary files a/dom/canvas/test/webgl-conf/checkout/resources/red-green.theora.ogv and /dev/null differ diff --git a/dom/canvas/test/webgl-conf/checkout/test-guidelines.md b/dom/canvas/test/webgl-conf/checkout/test-guidelines.md index 679892b1f0..b02738726e 100644 --- a/dom/canvas/test/webgl-conf/checkout/test-guidelines.md +++ b/dom/canvas/test/webgl-conf/checkout/test-guidelines.md @@ -18,7 +18,7 @@ the WebGL Working Group when "official" snapshots are taken. These lines must appear in a comment at the top of every code file under sdk/tests/conformance ``` -Copyright (c) 2019 The Khronos Group Inc. +Copyright (c) 2023 The Khronos Group Inc. Use of this source code is governed by an MIT-style license that can be found in the LICENSE.txt file. ``` @@ -102,7 +102,7 @@ found in the LICENSE.txt file. * Tests that are short and run synchronously end with - + * Tests that take a long time use setTimeout so as not to freeze the browser. @@ -144,7 +144,7 @@ found in the LICENSE.txt file. * Vendors may place test harness specific code in the testing infrastructure. - resources/js-test-pre.js + js/js-test-pre.js conformance/more/unit.js * Indent with spaces not tabs. (not everyone uses your tab settings). diff --git a/dom/canvas/test/webgl-conf/cherry_picks.txt b/dom/canvas/test/webgl-conf/cherry_picks.txt index cf84cd4492..f5342bb2b8 100644 --- a/dom/canvas/test/webgl-conf/cherry_picks.txt +++ b/dom/canvas/test/webgl-conf/cherry_picks.txt @@ -1,54 +1,17 @@ -commit 4f57098d0dbad68f41c87835fca5a6f0ba669350 -Author: Gregg Tavares -Date: Thu Nov 24 10:29:32 2022 -0800 +commit cd04892d7d7ac986a83383b06bfa792c9c369f8c +Author: Kelsey Gilbert +Date: Tue Apr 2 14:43:02 2024 -0700 - Test calling getUniform from non-current program - - It's possible this is already tested but I didn't see anything - obvious and Firefox fails this test - -commit d308751948807f08b36d06b0e8c835a1ffe078ae -Author: Kelsey Gilbert -Date: Tue Oct 18 15:21:32 2022 -0700 - - Add conformance/textures/misc/texture-srgb-upload.html. - - Test for both webgl1+ext and webgl2. - Test uploads from ArrayBuffer and (inlined) video. - Ensure that srgb textures fetch/decode 0x7f as 0.21 not 0.5. - - Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1696693 - -commit 50024c70fc8c8f1613275cffe90dea02a20297f3 -Author: Kelsey Gilbert -Date: Wed Aug 17 15:01:24 2022 -0700 - - Add test of gl_VertexID and gl_InstanceID. - - Includes details in new test about both state-of-specification, and known errata. - - Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1779800 - -commit 92af460e46a82d60140b5a1df1379feb79730d3a -Author: Kelsey Gilbert -Date: Tue Sep 6 15:21:32 2022 -0700 - - Add test for getUniformIndices. - - Also test to ensure that it returns the correct id by checking the name from getActiveUniform. - - Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1755973 + Remove more theora/.ogv from sdk/*. -Cherries picked +Above: cherries picked ================================================================================ -Merge base from: ups/main +Below: merge base from: ups/main -commit 4996b40a69857919579a12f828188c9f428c402c -Author: Alexey Knyazev <3479527+lexaknyazev@users.noreply.github.com> -Date: Sat Aug 20 01:53:01 2022 +0400 +commit 4c5b8bfe586d983fae6a0571cc702f43e5f5b719 +Author: Ken Russell +Date: Tue Apr 2 14:17:01 2024 -0700 - Allow makeXRCompatible in OffscreenCanvas contexts (#3480) + Verify invalidated uniform locations when there is no current program. (#3633) - Fixes failures of: - conformance/offscreencanvas/methods.html - conformance/offscreencanvas/methods-worker.html + Associated with crbug.com/331119482 . diff --git a/dom/canvas/test/webgl-conf/generated-mochitest.toml b/dom/canvas/test/webgl-conf/generated-mochitest.toml index 0cee17acf4..e63ef0abfd 100644 --- a/dom/canvas/test/webgl-conf/generated-mochitest.toml +++ b/dom/canvas/test/webgl-conf/generated-mochitest.toml @@ -65,6 +65,7 @@ support-files = [ "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-storage-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", @@ -104,15 +105,19 @@ support-files = [ "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-clip-control.html", "checkout/conformance/extensions/ext-color-buffer-half-float.html", + "checkout/conformance/extensions/ext-depth-clamp.html", "checkout/conformance/extensions/ext-disjoint-timer-query.html", "checkout/conformance/extensions/ext-float-blend.html", "checkout/conformance/extensions/ext-frag-depth.html", + "checkout/conformance/extensions/ext-polygon-offset-clamp.html", "checkout/conformance/extensions/ext-sRGB.html", "checkout/conformance/extensions/ext-shader-texture-lod.html", "checkout/conformance/extensions/ext-texture-compression-bptc.html", "checkout/conformance/extensions/ext-texture-compression-rgtc.html", "checkout/conformance/extensions/ext-texture-filter-anisotropic.html", + "checkout/conformance/extensions/ext-texture-mirror-clamp-to-edge.html", "checkout/conformance/extensions/get-extension.html", "checkout/conformance/extensions/khr-parallel-shader-compile.html", "checkout/conformance/extensions/oes-element-index-uint.html", @@ -133,6 +138,7 @@ support-files = [ "checkout/conformance/extensions/oes-vertex-array-object-bufferData.html", "checkout/conformance/extensions/oes-vertex-array-object.html", "checkout/conformance/extensions/s3tc-and-rgtc.html", + "checkout/conformance/extensions/webgl-blend-func-extended.html", "checkout/conformance/extensions/webgl-compressed-texture-astc.html", "checkout/conformance/extensions/webgl-compressed-texture-etc.html", "checkout/conformance/extensions/webgl-compressed-texture-etc1.html", @@ -147,6 +153,7 @@ support-files = [ "checkout/conformance/extensions/webgl-draw-buffers-max-draw-buffers.html", "checkout/conformance/extensions/webgl-draw-buffers.html", "checkout/conformance/extensions/webgl-multi-draw.html", + "checkout/conformance/extensions/webgl-polygon-mode.html", "checkout/conformance/extensions/webgl-webcodecs-video-frame.html", "checkout/conformance/glsl/00_test_list.txt", "checkout/conformance/glsl/bugs/00_test_list.txt", @@ -2597,6 +2604,7 @@ support-files = [ "checkout/conformance2/buffers/uniform-buffers.html", "checkout/conformance2/canvas/00_test_list.txt", "checkout/conformance2/canvas/compositing.html", + "checkout/conformance2/canvas/drawingbuffer-storage-test.html", "checkout/conformance2/canvas/to-data-url-with-pack-params.html", "checkout/conformance2/context/00_test_list.txt", "checkout/conformance2/context/constants-and-properties-2.html", @@ -2611,10 +2619,15 @@ support-files = [ "checkout/conformance2/extensions/00_test_list.txt", "checkout/conformance2/extensions/ext-color-buffer-float.html", "checkout/conformance2/extensions/ext-color-buffer-half-float.html", + "checkout/conformance2/extensions/ext-conservative-depth.html", "checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html", + "checkout/conformance2/extensions/ext-render-snorm.html", "checkout/conformance2/extensions/ext-texture-filter-anisotropic.html", "checkout/conformance2/extensions/ext-texture-norm16.html", + "checkout/conformance2/extensions/nv-shader-noperspective-interpolation.html", "checkout/conformance2/extensions/oes-draw-buffers-indexed.html", + "checkout/conformance2/extensions/oes-sample-variables.html", + "checkout/conformance2/extensions/oes-shader-multisample-interpolation.html", "checkout/conformance2/extensions/ovr_multiview2.html", "checkout/conformance2/extensions/ovr_multiview2_depth.html", "checkout/conformance2/extensions/ovr_multiview2_draw_buffers.html", @@ -2627,7 +2640,13 @@ support-files = [ "checkout/conformance2/extensions/promoted-extensions-in-shaders.html", "checkout/conformance2/extensions/promoted-extensions.html", "checkout/conformance2/extensions/required-extensions.html", + "checkout/conformance2/extensions/webgl-blend-func-extended.html", + "checkout/conformance2/extensions/webgl-clip-cull-distance.html", "checkout/conformance2/extensions/webgl-multi-draw-instanced-base-vertex-base-instance.html", + "checkout/conformance2/extensions/webgl-provoking-vertex.html", + "checkout/conformance2/extensions/webgl-render-shared-exponent.html", + "checkout/conformance2/extensions/webgl-shader-pixel-local-storage.html", + "checkout/conformance2/extensions/webgl-stencil-texturing.html", "checkout/conformance2/glsl3/00_test_list.txt", "checkout/conformance2/glsl3/array-as-return-value.html", "checkout/conformance2/glsl3/array-assign-constructor.html", @@ -2672,6 +2691,7 @@ support-files = [ "checkout/conformance2/glsl3/shader-with-mis-matching-uniform-block.html", "checkout/conformance2/glsl3/short-circuiting-in-loop-condition.html", "checkout/conformance2/glsl3/switch-case.html", + "checkout/conformance2/glsl3/texture-bias.html", "checkout/conformance2/glsl3/texture-offset-non-constant-offset.html", "checkout/conformance2/glsl3/texture-offset-out-of-range.html", "checkout/conformance2/glsl3/texture-offset-uniform-texture-coordinate.html", @@ -2714,6 +2734,7 @@ support-files = [ "checkout/conformance2/programs/gl-get-frag-data-location.html", "checkout/conformance2/programs/sampler-uniforms.html", "checkout/conformance2/query/00_test_list.txt", + "checkout/conformance2/query/occlusion-query-scissor.html", "checkout/conformance2/query/occlusion-query.html", "checkout/conformance2/query/query.html", "checkout/conformance2/reading/00_test_list.txt", @@ -2747,7 +2768,6 @@ support-files = [ "checkout/conformance2/rendering/blitframebuffer-stencil-only.html", "checkout/conformance2/rendering/blitframebuffer-test.html", "checkout/conformance2/rendering/blitframebuffer-unaffected-by-colormask.html", - "checkout/conformance2/rendering/builtin-vert-attribs.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", @@ -3511,6 +3531,7 @@ support-files = [ "checkout/conformance2/textures/misc/tex-3d-mipmap-levels-intel-bug.html", "checkout/conformance2/textures/misc/tex-3d-size-limit.html", "checkout/conformance2/textures/misc/tex-base-level-bug.html", + "checkout/conformance2/textures/misc/tex-image-10bpc.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", @@ -3758,6 +3779,19 @@ support-files = [ "checkout/conformance2/vertex_arrays/00_test_list.txt", "checkout/conformance2/vertex_arrays/vertex-array-object-and-disabled-attributes.html", "checkout/conformance2/vertex_arrays/vertex-array-object.html", + "checkout/conformance2/wasm/00_test_list.txt", + "checkout/conformance2/wasm/bufferdata-16gb-wasm-memory.html", + "checkout/conformance2/wasm/bufferdata-4gb-wasm-memory.html", + "checkout/conformance2/wasm/buffersubdata-16gb-wasm-memory.html", + "checkout/conformance2/wasm/buffersubdata-4gb-wasm-memory.html", + "checkout/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html", + "checkout/conformance2/wasm/getbuffersubdata-4gb-wasm-memory.html", + "checkout/conformance2/wasm/readpixels-16gb-wasm-memory.html", + "checkout/conformance2/wasm/readpixels-4gb-wasm-memory.html", + "checkout/conformance2/wasm/teximage2d-16gb-wasm-memory.html", + "checkout/conformance2/wasm/teximage2d-4gb-wasm-memory.html", + "checkout/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html", + "checkout/conformance2/wasm/texsubimage2d-4gb-wasm-memory.html", "checkout/deqp/00_test_list.txt", "checkout/deqp/LICENSE", "checkout/deqp/README.md", @@ -5018,6 +5052,7 @@ support-files = [ "checkout/js/tests/compressed-tex-image.js", "checkout/js/tests/compressed-texture-utils.js", "checkout/js/tests/context-methods.js", + "checkout/js/tests/drawingbuffer-storage-test.js", "checkout/js/tests/ext-color-buffer-half-float.js", "checkout/js/tests/ext-float-blend.js", "checkout/js/tests/ext-texture-filter-anisotropic.js", @@ -5068,6 +5103,7 @@ support-files = [ "checkout/js/tests/texture-corner-case-videos.js", "checkout/js/tests/typed-array-test-cases.js", "checkout/js/tests/typed-array-worker.js", + "checkout/js/tests/webgl-blend-func-extended.js", "checkout/js/tests/webgl-compressed-texture-size-limit.js", "checkout/js/tests/webgl-draw-buffers-utils.js", "checkout/js/webgl-test-harness.js", @@ -5090,18 +5126,18 @@ support-files = [ "checkout/resources/exif-orientation-originals/exif-orientation-test-3-rotate-180.jpg", "checkout/resources/exif-orientation-originals/exif-orientation-test-4-mirror-vertical.jpg", "checkout/resources/exif-orientation-originals/exif-orientation-test-5-mirror-horizontal-90-ccw.jpg", - "checkout/resources/exif-orientation-originals/exif-orientation-test-6-90-ccw.jpg", + "checkout/resources/exif-orientation-originals/exif-orientation-test-6-90-cw.jpg", "checkout/resources/exif-orientation-originals/exif-orientation-test-7-mirror-horizontal-90-cw.jpg", - "checkout/resources/exif-orientation-originals/exif-orientation-test-8-90-cw.jpg", + "checkout/resources/exif-orientation-originals/exif-orientation-test-8-90-ccw.jpg", "checkout/resources/exif-orientation-originals/exif-orientation-test.psd", "checkout/resources/exif-orientation-test-1-normal.jpg", "checkout/resources/exif-orientation-test-2-mirror-horizontal.jpg", "checkout/resources/exif-orientation-test-3-rotate-180.jpg", "checkout/resources/exif-orientation-test-4-mirror-vertical.jpg", "checkout/resources/exif-orientation-test-5-mirror-horizontal-90-ccw.jpg", - "checkout/resources/exif-orientation-test-6-90-ccw.jpg", + "checkout/resources/exif-orientation-test-6-90-cw.jpg", "checkout/resources/exif-orientation-test-7-mirror-horizontal-90-cw.jpg", - "checkout/resources/exif-orientation-test-8-90-cw.jpg", + "checkout/resources/exif-orientation-test-8-90-ccw.jpg", "checkout/resources/floatUniformShader.vert", "checkout/resources/fragmentShader.frag", "checkout/resources/glsl-feature-tests.css", @@ -5128,10 +5164,10 @@ support-files = [ "checkout/resources/noopUniformShaderES3.vert", "checkout/resources/npot-video-1920x1080.mp4", "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-gradient-8x1-10bit-untagged.png", "checkout/resources/red-green-128x128-linear-profile.jpg", "checkout/resources/red-green-128x128-linear-profile.psd", "checkout/resources/red-green-480x272-sar-136x135-dar-16x9.mp4", @@ -5145,7 +5181,6 @@ support-files = [ "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-indexed.png", "checkout/resources/samplerForWebGL2UniformShader.frag", @@ -5254,6 +5289,9 @@ subsuite = "webgl2-core" ["generated/test_2_conformance2__buffers__uniform-buffers.html"] subsuite = "webgl2-core" +["generated/test_2_conformance2__canvas__drawingbuffer-storage-test.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance2__canvas__to-data-url-with-pack-params.html"] subsuite = "webgl2-core" @@ -5295,9 +5333,15 @@ skip-if = ["os == 'mac' && debug"] ["generated/test_2_conformance2__extensions__ext-color-buffer-half-float.html"] subsuite = "webgl2-core" +["generated/test_2_conformance2__extensions__ext-conservative-depth.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance2__extensions__ext-disjoint-timer-query-webgl2.html"] subsuite = "webgl2-core" +["generated/test_2_conformance2__extensions__ext-render-snorm.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance2__extensions__ext-texture-filter-anisotropic.html"] subsuite = "webgl2-core" @@ -5309,9 +5353,18 @@ fail-if = [ "os == 'linux'", ] +["generated/test_2_conformance2__extensions__nv-shader-noperspective-interpolation.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance2__extensions__oes-draw-buffers-indexed.html"] subsuite = "webgl2-core" +["generated/test_2_conformance2__extensions__oes-sample-variables.html"] +subsuite = "webgl2-core" + +["generated/test_2_conformance2__extensions__oes-shader-multisample-interpolation.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance2__extensions__ovr_multiview2.html"] subsuite = "webgl2-core" fail-if = ["os == 'win'"] @@ -5357,10 +5410,28 @@ subsuite = "webgl2-core" subsuite = "webgl2-core" fail-if = ["os == 'linux'"] +["generated/test_2_conformance2__extensions__webgl-blend-func-extended.html"] +subsuite = "webgl2-core" + +["generated/test_2_conformance2__extensions__webgl-clip-cull-distance.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance2__extensions__webgl-multi-draw-instanced-base-vertex-base-instance.html"] subsuite = "webgl2-core" fail-if = ["os == 'mac' && !apple_silicon"] +["generated/test_2_conformance2__extensions__webgl-provoking-vertex.html"] +subsuite = "webgl2-core" + +["generated/test_2_conformance2__extensions__webgl-render-shared-exponent.html"] +subsuite = "webgl2-core" + +["generated/test_2_conformance2__extensions__webgl-shader-pixel-local-storage.html"] +subsuite = "webgl2-core" + +["generated/test_2_conformance2__extensions__webgl-stencil-texturing.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance2__glsl3__array-as-return-value.html"] subsuite = "webgl2-ext" @@ -5493,6 +5564,10 @@ subsuite = "webgl2-ext" subsuite = "webgl2-ext" fail-if = ["os == 'win'"] +["generated/test_2_conformance2__glsl3__texture-bias.html"] +subsuite = "webgl2-ext" +fail-if = ["os == 'win'"] + ["generated/test_2_conformance2__glsl3__texture-offset-non-constant-offset.html"] subsuite = "webgl2-ext" @@ -5620,6 +5695,9 @@ fail-if = ["os == 'android'"] ["generated/test_2_conformance2__programs__sampler-uniforms.html"] subsuite = "webgl2-core" +["generated/test_2_conformance2__query__occlusion-query-scissor.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance2__query__occlusion-query.html"] subsuite = "webgl2-core" skip-if = ["true"] @@ -5721,9 +5799,6 @@ subsuite = "webgl2-core" ["generated/test_2_conformance2__rendering__blitframebuffer-unaffected-by-colormask.html"] subsuite = "webgl2-core" -["generated/test_2_conformance2__rendering__builtin-vert-attribs.html"] -subsuite = "webgl2-core" - ["generated/test_2_conformance2__rendering__canvas-resizing-with-pbo-bound.html"] subsuite = "webgl2-core" @@ -8083,6 +8158,10 @@ subsuite = "webgl2-core" subsuite = "webgl2-core" fail-if = ["os == 'mac'"] # macosx1014 due to 1563418 +["generated/test_2_conformance2__textures__misc__tex-image-10bpc.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + ["generated/test_2_conformance2__textures__misc__tex-image-and-sub-image-with-array-buffer-view-sub-source.html"] subsuite = "webgl2-core" @@ -8875,6 +8954,54 @@ subsuite = "webgl2-core" ["generated/test_2_conformance2__vertex_arrays__vertex-array-object.html"] subsuite = "webgl2-core" +["generated/test_2_conformance2__wasm__bufferdata-16gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__bufferdata-4gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__buffersubdata-16gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__buffersubdata-4gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__getbuffersubdata-16gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__getbuffersubdata-4gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__readpixels-16gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__readpixels-4gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__teximage2d-16gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__teximage2d-4gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__texsubimage2d-16gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__texsubimage2d-4gb-wasm-memory.html"] +subsuite = "webgl2-core" +fail-if = ["true"] + ["generated/test_2_conformance__attribs__gl-bindAttribLocation-aliasing.html"] subsuite = "webgl2-core" @@ -9067,15 +9194,24 @@ subsuite = "webgl2-core" ["generated/test_2_conformance__context__zero-sized-canvas.html"] subsuite = "webgl2-core" +["generated/test_2_conformance__extensions__ext-clip-control.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance__extensions__ext-color-buffer-half-float.html"] subsuite = "webgl2-core" +["generated/test_2_conformance__extensions__ext-depth-clamp.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance__extensions__ext-disjoint-timer-query.html"] subsuite = "webgl2-core" ["generated/test_2_conformance__extensions__ext-float-blend.html"] subsuite = "webgl2-core" +["generated/test_2_conformance__extensions__ext-polygon-offset-clamp.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance__extensions__ext-texture-compression-bptc.html"] subsuite = "webgl2-core" @@ -9085,6 +9221,9 @@ subsuite = "webgl2-core" ["generated/test_2_conformance__extensions__ext-texture-filter-anisotropic.html"] subsuite = "webgl2-core" +["generated/test_2_conformance__extensions__ext-texture-mirror-clamp-to-edge.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance__extensions__get-extension.html"] subsuite = "webgl2-core" @@ -9125,6 +9264,9 @@ subsuite = "webgl2-core" ["generated/test_2_conformance__extensions__webgl-multi-draw.html"] subsuite = "webgl2-core" +["generated/test_2_conformance__extensions__webgl-polygon-mode.html"] +subsuite = "webgl2-core" + ["generated/test_2_conformance__glsl__bugs__angle-ambiguous-function-call.html"] subsuite = "webgl2-ext" @@ -14187,9 +14329,15 @@ skip-if = ["os == 'mac' && os_version == '10.15'"] ["generated/test_conformance__extensions__ext-blend-minmax.html"] subsuite = "webgl1-core" +["generated/test_conformance__extensions__ext-clip-control.html"] +subsuite = "webgl1-core" + ["generated/test_conformance__extensions__ext-color-buffer-half-float.html"] subsuite = "webgl1-core" +["generated/test_conformance__extensions__ext-depth-clamp.html"] +subsuite = "webgl1-core" + ["generated/test_conformance__extensions__ext-disjoint-timer-query.html"] subsuite = "webgl1-core" @@ -14199,6 +14347,9 @@ subsuite = "webgl1-core" ["generated/test_conformance__extensions__ext-frag-depth.html"] subsuite = "webgl1-core" +["generated/test_conformance__extensions__ext-polygon-offset-clamp.html"] +subsuite = "webgl1-core" + ["generated/test_conformance__extensions__ext-sRGB.html"] subsuite = "webgl1-core" fail-if = ["os == 'android'"] @@ -14215,6 +14366,9 @@ subsuite = "webgl1-core" ["generated/test_conformance__extensions__ext-texture-filter-anisotropic.html"] subsuite = "webgl1-core" +["generated/test_conformance__extensions__ext-texture-mirror-clamp-to-edge.html"] +subsuite = "webgl1-core" + ["generated/test_conformance__extensions__get-extension.html"] subsuite = "webgl1-core" @@ -14278,6 +14432,9 @@ subsuite = "webgl1-core" ["generated/test_conformance__extensions__s3tc-and-rgtc.html"] subsuite = "webgl1-core" +["generated/test_conformance__extensions__webgl-blend-func-extended.html"] +subsuite = "webgl1-core" + ["generated/test_conformance__extensions__webgl-compressed-texture-astc.html"] subsuite = "webgl1-core" @@ -14320,6 +14477,9 @@ subsuite = "webgl1-core" ["generated/test_conformance__extensions__webgl-multi-draw.html"] subsuite = "webgl1-core" +["generated/test_conformance__extensions__webgl-polygon-mode.html"] +subsuite = "webgl1-core" + ["generated/test_conformance__glsl__bugs__angle-ambiguous-function-call.html"] subsuite = "webgl1-ext" @@ -16705,7 +16865,7 @@ subsuite = "webgl1-core" skip-if = [ "win11_2009", # win11 - 50/50 intermittent "os == 'android' && android_version == '33'", #Bug 1873144 - ] + ] ["generated/test_conformance__textures__misc__texture-npot.html"] subsuite = "webgl1-core" diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__canvas__drawingbuffer-storage-test.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__canvas__drawingbuffer-storage-test.html new file mode 100644 index 0000000000..00fba64f26 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__canvas__drawingbuffer-storage-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__extensions__ext-conservative-depth.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-conservative-depth.html new file mode 100644 index 0000000000..2ae10d93fe --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-conservative-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__extensions__ext-render-snorm.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-render-snorm.html new file mode 100644 index 0000000000..aa47f840a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__ext-render-snorm.html @@ -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__nv-shader-noperspective-interpolation.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__nv-shader-noperspective-interpolation.html new file mode 100644 index 0000000000..c4e820eaae --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__nv-shader-noperspective-interpolation.html @@ -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__oes-sample-variables.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__oes-sample-variables.html new file mode 100644 index 0000000000..a7582e4fa4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__oes-sample-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_conformance2__extensions__oes-shader-multisample-interpolation.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__oes-shader-multisample-interpolation.html new file mode 100644 index 0000000000..f7fae5d1c5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__oes-shader-multisample-interpolation.html @@ -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__webgl-blend-func-extended.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-blend-func-extended.html new file mode 100644 index 0000000000..d0ad1a13bf --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-blend-func-extended.html @@ -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__webgl-clip-cull-distance.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-clip-cull-distance.html new file mode 100644 index 0000000000..f2b113ac78 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-clip-cull-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_conformance2__extensions__webgl-provoking-vertex.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-provoking-vertex.html new file mode 100644 index 0000000000..132519dff3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-provoking-vertex.html @@ -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__webgl-render-shared-exponent.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-render-shared-exponent.html new file mode 100644 index 0000000000..7d4a15493b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-render-shared-exponent.html @@ -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__webgl-shader-pixel-local-storage.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-shader-pixel-local-storage.html new file mode 100644 index 0000000000..4b30aadc2b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-shader-pixel-local-storage.html @@ -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__webgl-stencil-texturing.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-stencil-texturing.html new file mode 100644 index 0000000000..f867f36977 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__extensions__webgl-stencil-texturing.html @@ -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-bias.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__texture-bias.html new file mode 100644 index 0000000000..6ec1ed29d4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__glsl3__texture-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_conformance2__query__occlusion-query-scissor.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__query__occlusion-query-scissor.html new file mode 100644 index 0000000000..9337ee8fd4 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__query__occlusion-query-scissor.html @@ -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__builtin-vert-attribs.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__builtin-vert-attribs.html deleted file mode 100644 index 0c6200a9a9..0000000000 --- a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__rendering__builtin-vert-attribs.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - Mochitest wrapper for WebGL Conformance Test Suite tests - - - - - - - - - - diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-10bpc.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-10bpc.html new file mode 100644 index 0000000000..c6f5f90019 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__textures__misc__tex-image-10bpc.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__bufferdata-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__bufferdata-16gb-wasm-memory.html new file mode 100644 index 0000000000..d005e42f84 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__bufferdata-16gb-wasm-memory.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__bufferdata-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__bufferdata-4gb-wasm-memory.html new file mode 100644 index 0000000000..81d331a5be --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__bufferdata-4gb-wasm-memory.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__buffersubdata-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__buffersubdata-16gb-wasm-memory.html new file mode 100644 index 0000000000..09b63204a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__buffersubdata-16gb-wasm-memory.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__buffersubdata-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__buffersubdata-4gb-wasm-memory.html new file mode 100644 index 0000000000..6d0240794b --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__buffersubdata-4gb-wasm-memory.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__getbuffersubdata-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__getbuffersubdata-16gb-wasm-memory.html new file mode 100644 index 0000000000..3bbe93a68a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__getbuffersubdata-16gb-wasm-memory.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__getbuffersubdata-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__getbuffersubdata-4gb-wasm-memory.html new file mode 100644 index 0000000000..d310a733f6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__getbuffersubdata-4gb-wasm-memory.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__readpixels-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__readpixels-16gb-wasm-memory.html new file mode 100644 index 0000000000..342b9e7015 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__readpixels-16gb-wasm-memory.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__readpixels-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__readpixels-4gb-wasm-memory.html new file mode 100644 index 0000000000..d772a2824a --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__readpixels-4gb-wasm-memory.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__teximage2d-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__teximage2d-16gb-wasm-memory.html new file mode 100644 index 0000000000..5ce7bdb9bd --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__teximage2d-16gb-wasm-memory.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__teximage2d-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__teximage2d-4gb-wasm-memory.html new file mode 100644 index 0000000000..135f5b4a32 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__teximage2d-4gb-wasm-memory.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__texsubimage2d-16gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__texsubimage2d-16gb-wasm-memory.html new file mode 100644 index 0000000000..eca227b3a5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__texsubimage2d-16gb-wasm-memory.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__texsubimage2d-4gb-wasm-memory.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__texsubimage2d-4gb-wasm-memory.html new file mode 100644 index 0000000000..b5b2d1cc6f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance2__wasm__texsubimage2d-4gb-wasm-memory.html @@ -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-clip-control.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-clip-control.html new file mode 100644 index 0000000000..0cdc6e1101 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-clip-control.html @@ -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-depth-clamp.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-depth-clamp.html new file mode 100644 index 0000000000..9cb87c0570 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-depth-clamp.html @@ -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-polygon-offset-clamp.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-polygon-offset-clamp.html new file mode 100644 index 0000000000..b0df2ff3bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-polygon-offset-clamp.html @@ -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-mirror-clamp-to-edge.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-texture-mirror-clamp-to-edge.html new file mode 100644 index 0000000000..470477e4de --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__ext-texture-mirror-clamp-to-edge.html @@ -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-polygon-mode.html b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-polygon-mode.html new file mode 100644 index 0000000000..642d0dc652 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_2_conformance__extensions__webgl-polygon-mode.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-clip-control.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-clip-control.html new file mode 100644 index 0000000000..7fb1b875ce --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-clip-control.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-depth-clamp.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-depth-clamp.html new file mode 100644 index 0000000000..f6162ae15f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-depth-clamp.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-polygon-offset-clamp.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-polygon-offset-clamp.html new file mode 100644 index 0000000000..b1a736ebb3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-polygon-offset-clamp.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-mirror-clamp-to-edge.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-texture-mirror-clamp-to-edge.html new file mode 100644 index 0000000000..d13072949f --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__ext-texture-mirror-clamp-to-edge.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-blend-func-extended.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-blend-func-extended.html new file mode 100644 index 0000000000..66d1fcefda --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-blend-func-extended.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-polygon-mode.html b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-polygon-mode.html new file mode 100644 index 0000000000..c7783dc938 --- /dev/null +++ b/dom/canvas/test/webgl-conf/generated/test_conformance__extensions__webgl-polygon-mode.html @@ -0,0 +1,17 @@ + + + + + + + Mochitest wrapper for WebGL Conformance Test Suite tests + + + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/mochitest-errata.toml b/dom/canvas/test/webgl-conf/mochitest-errata.toml index 5bf2b3f89b..e036a20ba1 100644 --- a/dom/canvas/test/webgl-conf/mochitest-errata.toml +++ b/dom/canvas/test/webgl-conf/mochitest-errata.toml @@ -29,6 +29,68 @@ prefs = "media.seamless-looping-video=false" ["generated/test_..__always-fail.html"] fail-if = ["true"] +#################### +# Failures from 2024-04 CTS update + +["generated/test_2_conformance2__textures__misc__tex-image-10bpc.html"] +# gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36053. Was 36054. +# uniquePixels.size should be >= 7. Was 1 (of type number). +fail-if = ["true"] + + +["generated/test_2_conformance2__wasm__bufferdata-16gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__bufferdata-4gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__buffersubdata-16gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__buffersubdata-4gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__getbuffersubdata-16gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__getbuffersubdata-4gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__readpixels-16gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__readpixels-4gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__teximage2d-16gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__teximage2d-4gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__texsubimage2d-16gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__wasm__texsubimage2d-4gb-wasm-memory.html"] +# successfullyParsed should be true (of type boolean). Was undefined (of type undefined). +fail-if = ["true"] + +["generated/test_2_conformance2__glsl3__texture-bias.html"] +# should be: 3,3,3,3 +# should be: 13,13,13,13 +fail-if = ["os == 'win'"] + #################### # Bugs surfaced during fx106 CTS update diff --git a/dom/canvas/test/webgl-conf/moz.yaml b/dom/canvas/test/webgl-conf/moz.yaml index 7ebde7dcb2..fc40ba1b4d 100644 --- a/dom/canvas/test/webgl-conf/moz.yaml +++ b/dom/canvas/test/webgl-conf/moz.yaml @@ -13,8 +13,8 @@ origin: license: MIT - release: commit 4996b40a69857919579a12f828188c9f428c402c Fri Aug 19 14:53:01 2022 -0700 - revision: 4996b40a69857919579a12f828188c9f428c402c + release: commit 4c5b8bfe586d983fae6a0571cc702f43e5f5b719 Tue Apr 2 14:17:01 2024 -0700 + revision: 4c5b8bfe586d983fae6a0571cc702f43e5f5b719 updatebot: diff --git a/dom/canvas/test/webgl-mochitest/mochitest.toml b/dom/canvas/test/webgl-mochitest/mochitest.toml index 88e2fab88b..88b9b8ae91 100644 --- a/dom/canvas/test/webgl-mochitest/mochitest.toml +++ b/dom/canvas/test/webgl-mochitest/mochitest.toml @@ -8,7 +8,6 @@ support-files = [ "webgl-util.js", "test_video_fastpath.js", "red-green.mp4", - "red-green.theora.ogv", "red-green.webmvp8.webm", "red-green.webmvp9.webm", ] @@ -199,20 +198,12 @@ support-files = ["blank_15000x10000.png"] ["test_video_fastpath_mp4.html"] skip-if = ["win11_2009 && bits == 32"] # No fast video path for h264 decoder (done in RDD, can't be read in content) -["test_video_fastpath_theora.html"] -skip-if = [ - "os == 'linux' && os_version == '18.04'", - "apple_catalina", - "apple_silicon", - "win11_2009 && bits == 32", # No fast video path for theora decoder (done in RDD, can't be read in content) -] - ["test_video_fastpath_vp8.html"] skip-if = [ "os == 'linux' && os_version == '18.04'", "apple_catalina", "apple_silicon", - "win11_2009 && bits == 32", # No fast video path for theora decoder (done in RDD, can't be read in content) + "win11_2009 && bits == 32", # No fast video path for vp8 decoder (done in RDD, can't be read in content) ] ["test_video_fastpath_vp9.html"] @@ -220,7 +211,7 @@ skip-if = [ "os == 'linux' && os_version == '18.04'", "apple_catalina", "apple_silicon", - "win11_2009 && bits == 32", # No fast video path for theora decoder (done in RDD, can't be read in content) + "win11_2009 && bits == 32", # No fast video path for vp9 decoder (done in RDD, can't be read in content) ] ["test_webgl2_alpha_luminance.html"] diff --git a/dom/canvas/test/webgl-mochitest/red-green.theora.ogv b/dom/canvas/test/webgl-mochitest/red-green.theora.ogv deleted file mode 100644 index 1543915a10..0000000000 Binary files a/dom/canvas/test/webgl-mochitest/red-green.theora.ogv and /dev/null differ diff --git a/dom/canvas/test/webgl-mochitest/test_video_fastpath_theora.html b/dom/canvas/test/webgl-mochitest/test_video_fastpath_theora.html deleted file mode 100644 index 4f4fbab88b..0000000000 --- a/dom/canvas/test/webgl-mochitest/test_video_fastpath_theora.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Video Fastpath upload test - - - - - - - - -- cgit v1.2.3