From b672f22f088c7a7c6175af8357dfbd69a2aab60a Mon Sep 17 00:00:00 2001 From: Jeff Gilbert Date: Wed, 25 Mar 2020 05:40:54 +0000 Subject: [PATCH] Bug 1624768 - Forbid multisampled unsized DEPTH_STENCIL. r=lsalzman Differential Revision: https://phabricator.services.mozilla.com/D68135 --HG-- extra : moz-landing-system : lando --- dom/canvas/ClientWebGLContext.cpp | 8 ++++++++ dom/canvas/test/webgl-conf/generated-mochitest.ini | 2 +- dom/canvas/test/webgl-conf/mochitest-errata.ini | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dom/canvas/ClientWebGLContext.cpp b/dom/canvas/ClientWebGLContext.cpp index b633beaa0ed1..2bfbb22905b2 100644 --- a/dom/canvas/ClientWebGLContext.cpp +++ b/dom/canvas/ClientWebGLContext.cpp @@ -3181,6 +3181,14 @@ void ClientWebGLContext::RenderbufferStorageMultisample(GLenum target, return; } + if (internalFormat == LOCAL_GL_DEPTH_STENCIL && samples > 0) { + // While our backend supports it trivially, the spec forbids it. + EnqueueError(LOCAL_GL_INVALID_OPERATION, + "WebGL 1's DEPTH_STENCIL format may not be multisampled. Use " + "DEPTH24_STENCIL8 when `samples > 0`."); + return; + } + Run( rb->mId, static_cast(samples), internalFormat, static_cast(width), static_cast(height)); diff --git a/dom/canvas/test/webgl-conf/generated-mochitest.ini b/dom/canvas/test/webgl-conf/generated-mochitest.ini index f037a515316b..0d47a180bdf5 100644 --- a/dom/canvas/test/webgl-conf/generated-mochitest.ini +++ b/dom/canvas/test/webgl-conf/generated-mochitest.ini @@ -5307,7 +5307,7 @@ subsuite = webgl2-core subsuite = webgl2-core [generated/test_2_conformance2__renderbuffers__multisampled-depth-renderbuffer-initialization.html] subsuite = webgl2-core -fail-if = 1 +fail-if = (os == 'mac') [generated/test_2_conformance2__renderbuffers__multisampled-renderbuffer-initialization.html] subsuite = webgl2-core fail-if = (os == 'android') diff --git a/dom/canvas/test/webgl-conf/mochitest-errata.ini b/dom/canvas/test/webgl-conf/mochitest-errata.ini index 249737fd44cd..2ef5365c9e3f 100644 --- a/dom/canvas/test/webgl-conf/mochitest-errata.ini +++ b/dom/canvas/test/webgl-conf/mochitest-errata.ini @@ -246,8 +246,6 @@ fail-if = 1 fail-if = os == 'mac' && os_version == '10.14' # macosx1014 due to 1563418 [generated/test_2_conformance2__textures__misc__tex-unpack-params-with-flip-y-and-premultiply-alpha.html] fail-if = 1 -[generated/test_2_conformance2__renderbuffers__multisampled-depth-renderbuffer-initialization.html] -fail-if = 1 #################################################### # Bugs @@ -852,6 +850,8 @@ skip-if = (os == 'mac') [generated/test_2_conformance2__textures__misc__tex-unpack-params-imagedata.html] # areArraysEqual(actual, expected) should be true. Was false. fail-if = (os == 'mac') +[generated/test_2_conformance2__renderbuffers__multisampled-depth-renderbuffer-initialization.html] +fail-if = (os == 'mac') #################### # failure on OSX