Title: [271444] trunk
Revision
271444
Author
[email protected]
Date
2021-01-13 10:56:35 -0800 (Wed, 13 Jan 2021)

Log Message

[WebGL2] fbostatequery, negativebufferapi, negativevertexarrayapi, shaderstatequery conformance failures
https://bugs.webkit.org/show_bug.cgi?id=220372

Patch by Kenneth Russell <[email protected]> on 2021-01-13
Reviewed by Darin Adler.

Source/ThirdParty/ANGLE:

Add a needed early-out in drawArraysInstanced validation when the
primitive count is zero. This patch will be upstreamed to ANGLE
afterward.

* src/libANGLE/validationES.h:
(gl::ValidateDrawArraysAttribs):
(gl::ValidateDrawArraysCommon):

Source/WebCore:

Fix validation of program and shader objects to address
conformance test failures. Unify and clean up validation of some
other object types.

Fix bugs in queries of framebuffer attachments and integer vertex
attributes.

Remove an old macOS workaround from GraphicsContextGLANGLE which
was causing test failures of maximum renderbuffer sizes.

Generate tests' expected OpenGL errors for a few APIs.

Covered by existing WebGL 2.0 conformance tests.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::copyBufferSubData):
(WebCore::WebGL2RenderingContext::bindFramebuffer):
(WebCore::WebGL2RenderingContext::getFragDataLocation):
(WebCore::WebGL2RenderingContext::vertexAttribIPointer):
(WebCore::WebGL2RenderingContext::drawBuffers):
(WebCore::WebGL2RenderingContext::isQuery):
(WebCore::WebGL2RenderingContext::beginQuery):
(WebCore::WebGL2RenderingContext::getQueryParameter):
(WebCore::WebGL2RenderingContext::isSampler):
(WebCore::WebGL2RenderingContext::isSync):
(WebCore::WebGL2RenderingContext::deleteSync):
(WebCore::WebGL2RenderingContext::clientWaitSync):
(WebCore::WebGL2RenderingContext::waitSync):
(WebCore::WebGL2RenderingContext::getSyncParameter):
(WebCore::WebGL2RenderingContext::deleteTransformFeedback):
(WebCore::WebGL2RenderingContext::isTransformFeedback):
(WebCore::WebGL2RenderingContext::bindTransformFeedback):
(WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
(WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
(WebCore::WebGL2RenderingContext::setIndexedBufferBinding):
(WebCore::WebGL2RenderingContext::getUniformIndices):
(WebCore::WebGL2RenderingContext::getActiveUniforms):
(WebCore::WebGL2RenderingContext::getUniformBlockIndex):
(WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
(WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
(WebCore::WebGL2RenderingContext::uniformBlockBinding):
(WebCore::WebGL2RenderingContext::deleteVertexArray):
(WebCore::WebGL2RenderingContext::isVertexArray):
(WebCore::WebGL2RenderingContext::bindVertexArray):
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
* html/canvas/WebGLObject.cpp:
(WebCore::WebGLObject::deleteObject):
* html/canvas/WebGLObject.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::attachShader):
(WebCore::WebGLRenderingContextBase::bindAttribLocation):
(WebCore::WebGLRenderingContextBase::validateNullableWebGLObject):
(WebCore::WebGLRenderingContextBase::bindBuffer):
(WebCore::WebGLRenderingContextBase::bindFramebuffer):
(WebCore::WebGLRenderingContextBase::bindRenderbuffer):
(WebCore::WebGLRenderingContextBase::bindTexture):
(WebCore::WebGLRenderingContextBase::compileShader):
(WebCore::WebGLRenderingContextBase::detachShader):
(WebCore::WebGLRenderingContextBase::validateWebGLObject):
(WebCore::WebGLRenderingContextBase::validateWebGLProgramOrShader):
(WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
(WebCore::WebGLRenderingContextBase::framebufferTexture2D):
(WebCore::WebGLRenderingContextBase::getActiveAttrib):
(WebCore::WebGLRenderingContextBase::getActiveUniform):
(WebCore::WebGLRenderingContextBase::getAttachedShaders):
(WebCore::WebGLRenderingContextBase::getAttribLocation):
(WebCore::WebGLRenderingContextBase::getProgramInfoLog):
(WebCore::WebGLRenderingContextBase::getShaderInfoLog):
(WebCore::WebGLRenderingContextBase::getShaderSource):
(WebCore::WebGLRenderingContextBase::getUniform):
(WebCore::WebGLRenderingContextBase::getUniformLocation):
(WebCore::WebGLRenderingContextBase::getVertexAttrib):
(WebCore::WebGLRenderingContextBase::isBuffer):
(WebCore::WebGLRenderingContextBase::isFramebuffer):
(WebCore::WebGLRenderingContextBase::isProgram):
(WebCore::WebGLRenderingContextBase::isRenderbuffer):
(WebCore::WebGLRenderingContextBase::isShader):
(WebCore::WebGLRenderingContextBase::isTexture):
(WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
(WebCore::WebGLRenderingContextBase::shaderSource):
(WebCore::WebGLRenderingContextBase::useProgram):
(WebCore::WebGLRenderingContextBase::validateProgram):
(WebCore::WebGLRenderingContextBase::vertexAttribPointer):
(WebCore::WebGLRenderingContextBase::drawArraysInstanced):
(WebCore::WebGLRenderingContextBase::drawElementsInstanced):
(WebCore::WebGLRenderingContextBase::checkObjectToBeBound): Deleted.
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLVertexArrayObjectBase.cpp:
(WebCore::WebGLVertexArrayObjectBase::setVertexAttribState):
* html/canvas/WebGLVertexArrayObjectBase.h:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::getIntegerv):

LayoutTests:

Rebaseline tests which are either now passing or which have
progressed.

* webgl/2.0.0/conformance/programs/program-test-expected.txt:
* webgl/2.0.0/conformance2/state/gl-object-get-calls-expected.txt:
* webgl/2.0.0/deqp/functional/gles3/fbostatequery-expected.txt:
* webgl/2.0.0/deqp/functional/gles3/negativebufferapi-expected.txt:
* webgl/2.0.0/deqp/functional/gles3/negativevertexarrayapi-expected.txt:
* webgl/2.0.0/deqp/functional/gles3/shaderstatequery-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (271443 => 271444)


--- trunk/LayoutTests/ChangeLog	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/LayoutTests/ChangeLog	2021-01-13 18:56:35 UTC (rev 271444)
@@ -1,3 +1,20 @@
+2021-01-13  Kenneth Russell  <[email protected]>
+
+        [WebGL2] fbostatequery, negativebufferapi, negativevertexarrayapi, shaderstatequery conformance failures
+        https://bugs.webkit.org/show_bug.cgi?id=220372
+
+        Reviewed by Darin Adler.
+
+        Rebaseline tests which are either now passing or which have
+        progressed.
+
+        * webgl/2.0.0/conformance/programs/program-test-expected.txt:
+        * webgl/2.0.0/conformance2/state/gl-object-get-calls-expected.txt:
+        * webgl/2.0.0/deqp/functional/gles3/fbostatequery-expected.txt:
+        * webgl/2.0.0/deqp/functional/gles3/negativebufferapi-expected.txt:
+        * webgl/2.0.0/deqp/functional/gles3/negativevertexarrayapi-expected.txt:
+        * webgl/2.0.0/deqp/functional/gles3/shaderstatequery-expected.txt:
+
 2021-01-13  Rini Patel  <[email protected]>
 
         [GPU process] Some more Layout tests failures in TestExpectations

Modified: trunk/LayoutTests/webgl/2.0.0/conformance/programs/program-test-expected.txt (271443 => 271444)


--- trunk/LayoutTests/webgl/2.0.0/conformance/programs/program-test-expected.txt	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/LayoutTests/webgl/2.0.0/conformance/programs/program-test-expected.txt	2021-01-13 18:56:35 UTC (rev 271444)
@@ -1,83 +1,4 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../resources/webgl_test_files/conformance/programs/program-test.html
-
-[ 1: PASS ] context exists
-[ 2: PASS ] good vertex shader should compile
-[ 3: PASS ] getError was expected value: NO_ERROR : should be no errors at this point
-[ 4: PASS ] invalid call to getShaderParameter should return null
-[ 5: PASS ] getError was expected value: INVALID_ENUM : INFO_LOG_LENGTH is not a valid argument to getShaderParameter in WebGL
-[ 6: PASS ] invalid call to getShaderParameter should return null
-[ 7: PASS ] getError was expected value: INVALID_ENUM : SHADER_SOURCE_LENGTH is not a valid argument to getShaderParameter in WebGL
-[ 8: PASS ] good vertex shader #2 should compile
-[ 9: PASS ] good fragment shader should compile
-[ 10: PASS ] good fragment shader #2 should compile
-[ 11: PASS ] getError was expected value: NO_ERROR : should be no errors at this point
-[ 12: PASS ] getError was expected value: NO_ERROR : attaching a vertex shader should succeed
-[ 13: PASS ] getError was expected value: INVALID_OPERATION : attaching an already attached vertex shader should generate INVALID_OPERATION
-[ 14: PASS ] getError was expected value: NO_ERROR : attaching a fragment shader should succeed
-[ 15: PASS ] getError was expected value: INVALID_OPERATION : attaching an already attached fragment shader should generate INVALID_OPERATION
-[ 16: PASS ] getError was expected value: INVALID_OPERATION : attaching shaders of the same type to a program should generate INVALID_OPERATION
-[ 17: PASS ] getError was expected value: INVALID_OPERATION : attaching shaders of the same type to a program should generate INVALID_OPERATION
-[ 18: PASS ] getError was expected value: NO_ERROR : detaching a vertex shader should succeed
-[ 19: PASS ] getError was expected value: INVALID_OPERATION : detaching a not already attached vertex shader should generate INVALID_OPERATION
-[ 20: PASS ] getError was expected value: NO_ERROR : detaching a fragment shader should succeed
-[ 21: PASS ] getError was expected value: INVALID_OPERATION : detaching a not already attached fragment shader should generate INVALID_OPERATION
-[ 22: PASS ] getAttachedShaders should return an empty list by default
-[ 23: PASS ] attaching a single shader should give the expected list
-[ 24: PASS ] attaching some shaders should give the expected list
-[ 25: PASS ] attaching a shader and detaching it should leave an empty list
-[ 26: PASS ] attaching some shaders and detaching them in same order should leave an empty list
-[ 27: PASS ] attaching some shaders and detaching them in random order should leave an empty list
-[ 28: PASS ] attaching and detaching some shaders should leave the difference list
-[ 29: PASS ] attaching and detaching some shaders should leave the difference list
-[ 30: PASS ] attaching a shader that failed to compile should still show it in the list
-[ 31: PASS ] attaching shaders, including one that failed to compile, should still show the it in the list
-[ 32: PASS ] valid program should link
-[ 33: PASS ] invalid call to getProgramParameter should return null
-[ 34: PASS ] getError was expected value: INVALID_ENUM : INFO_LOG_LENGTH is not a valid argument to getProgramParameter in WebGL
-[ 35: PASS ] invalid call to getProgramParameter should return null
-[ 36: PASS ] getError was expected value: INVALID_ENUM : ACTIVE_ATTRIBUTE_MAX_LENGTH is not a valid argument to getProgramParameter in WebGL
-[ 37: PASS ] invalid call to getProgramParameter should return null
-[ 38: PASS ] getError was expected value: INVALID_ENUM : ACTIVE_UNIFORM_MAX_LENGTH is not a valid argument to getProgramParameter in WebGL
-[ 39: PASS ] getError was expected value: NO_ERROR : using a valid program should succeed
-[ 40: PASS ] valid program #2 should link
-[ 41: PASS ] getError was expected value: NO_ERROR : using a valid program should succeed
-[ 42: PASS ] program with no fragment shader should fail to link
-[ 43: PASS ] getError was expected value: INVALID_OPERATION : using an invalid program should generate INVALID_OPERATION
-[ 44: PASS ] program with no vertex shader should fail to link
-[ 45: PASS ] getError was expected value: INVALID_OPERATION : using an invalid program should generate INVALID_OPERATION
-[ 46: PASS ] program with bad vertex shader should fail to link
-[ 47: PASS ] getError was expected value: INVALID_OPERATION : using an invalid program should generate INVALID_OPERATION
-[ 48: PASS ] program with bad fragment shader should fail to link
-[ 49: PASS ] getError was expected value: INVALID_OPERATION : using an invalid program should generate INVALID_OPERATION
-[ 50: PASS ] program with bad shaders should fail to link
-[ 51: PASS ] getError was expected value: INVALID_OPERATION : using an invalid program should generate INVALID_OPERATION
-[ 52: PASS ] getError was expected value: NO_ERROR : using a valid program shouldn't generate a GL error
-[ 53: PASS ] getError was expected value: NO_ERROR : should be no errors at this point #2
-[ 54: PASS ] getError was expected value: INVALID_OPERATION : drawing with a null program should generate INVALID_OPERATION
-[ 55: PASS ] getError was expected value: NO_ERROR : drawing with a valid program shouldn't generate a GL error
-[ 56: PASS ] getError was expected value: INVALID_OPERATION : using an invalid program should generate INVALID_OPERATION
-[ 57: PASS ] getError was expected value: NO_ERROR : Try to use an invalid program should not change the current rendering state
-[ 58: PASS ] getError was expected value: NO_ERROR : drawing with a valid program shouldn't generate a GL error
-[ 59: PASS ] linking should fail with in-use formerly good program, with new bad shader attached
-[ 60: PASS ] getError was expected value: NO_ERROR : drawing with a valid program shouldn't generate a GL error
-[ 61: PASS ] getError was expected value: NO_ERROR : drawing with a valid when last used program shouldn't generate a GL error
-[ 62: PASS ] delete shaders after attaching them and before linking program should not affect linkProgram
-[ 63: PASS ] getError was expected value: NO_ERROR : using a valid program should succeed
-[ 64: PASS ] getError was expected value: NO_ERROR : drawing with a valid when last used program shouldn't generate a GL error
-[ 65: PASS ] getError was expected value: NO_ERROR : delete the current program shouldn't change the current rendering state
-[ 66: PASS ] getError was expected value: NO_ERROR : The current program shouldn't be deleted
-[ 67: PASS ] good fragment shader should compile
-[ 68: PASS ] getError was expected value: INVALID_VALUE : an unattached shader should be deleted immediately
-[ 69: PASS ] good fragment shader should compile
-[ 70: FAIL ] an attached shader shouldn't be deleted
-[ 71: FAIL ] getError expected: INVALID_VALUE. Was INVALID_OPERATION : a delete-marked program should be deleted once it's no longer the current program
-[ 72: PASS ] getError was expected value: INVALID_VALUE : a delete-marked shader should be deleted once all its attachments are removed
-[ 73: PASS ] should be red
-[ 74: PASS ] should be green
-[ 75: PASS ] should be red
-[ 76: PASS ] should be tranparent black
-[ 77: PASS ] getError was expected value: NO_ERROR : should be no errors
-[ 78: PASS ] successfullyParsed is true
-[ FAIL ] 2 failures reported
+[ PASS ] All tests passed

Modified: trunk/LayoutTests/webgl/2.0.0/conformance2/state/gl-object-get-calls-expected.txt (271443 => 271444)


--- trunk/LayoutTests/webgl/2.0.0/conformance2/state/gl-object-get-calls-expected.txt	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/LayoutTests/webgl/2.0.0/conformance2/state/gl-object-get-calls-expected.txt	2021-01-13 18:56:35 UTC (rev 271444)
@@ -42,7 +42,7 @@
 [ 38: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 0, gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE) is non-zero.
 [ 39: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 0, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE) is non-zero.
 [ 40: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 0, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING) is non-zero.
-[ 41: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER) should be 0 (of type number). Was null (of type object).
+[ 41: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER) is 0
 [ 42: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.TEXTURE
 [ 43: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is anotherTexture
 [ 44: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL) is 0
@@ -53,13 +53,13 @@
 [ 49: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE) is non-zero.
 [ 50: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE) is non-zero.
 [ 51: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING) is non-zero.
-[ 52: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER) should be 0 (of type number). Was null (of type object).
+[ 52: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER) is 0
 [ 53: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.RENDERBUFFER
 [ 54: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is renderbuffer
 [ 55: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.RENDERBUFFER
 [ 56: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is renderbuffer
-[ 57: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) should be 36161. Was 0.
-[ 58: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) should be [object WebGLRenderbuffer]. Was null.
+[ 57: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.RENDERBUFFER
+[ 58: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is renderbuffer
 [ 59: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE) is non-zero.
 [ 60: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE) is non-zero.
 [ 61: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE) is non-zero.
@@ -66,15 +66,15 @@
 [ 62: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING) is non-zero.
 [ 63: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE) is non-zero.
 [ 64: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING) is non-zero.
-[ 65: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_ENUM : after evaluating: gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)
+[ 65: PASS ] getError was expected value: INVALID_OPERATION : after evaluating: gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)
 [ 66: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING) is non-zero.
-[ 67: FAIL ] getFramebufferAttachmentParameter did not generate INVALID_ENUM for invalid parameter enum: NO_ERROR
+[ 67: PASS ] getFramebufferAttachmentParameter correctly handled invalid parameter enums
 [ 68: PASS ] getFramebufferAttachmentParameter correctly handled invalid target enums
 [ 69: PASS ] getFramebufferAttachmentParameter correctly handled invalid attachment enums
 [ 70: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_COMPLETE
-[ 71: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) should be 33304. Was 5890.
-[ 72: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) should be 33304. Was 0.
-[ 73: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) should be 33304. Was 0.
+[ 71: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.FRAMEBUFFER_DEFAULT
+[ 72: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.FRAMEBUFFER_DEFAULT
+[ 73: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.FRAMEBUFFER_DEFAULT
 [ 74: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_RED_SIZE) is non-zero.
 [ 75: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE) is non-zero.
 [ 76: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE) is non-zero.
@@ -105,7 +105,7 @@
 [ 101: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 0, gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE) is non-zero.
 [ 102: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 0, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE) is non-zero.
 [ 103: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 0, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING) is non-zero.
-[ 104: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER) should be 0 (of type number). Was null (of type object).
+[ 104: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER) is 0
 [ 105: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.TEXTURE
 [ 106: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is anotherTexture
 [ 107: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL) is 0
@@ -116,13 +116,13 @@
 [ 112: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE) is non-zero.
 [ 113: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE) is non-zero.
 [ 114: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING) is non-zero.
-[ 115: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER) should be 0 (of type number). Was null (of type object).
+[ 115: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 7, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER) is 0
 [ 116: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.RENDERBUFFER
 [ 117: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is renderbuffer
 [ 118: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.RENDERBUFFER
 [ 119: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is renderbuffer
-[ 120: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) should be 36161. Was 0.
-[ 121: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) should be [object WebGLRenderbuffer]. Was null.
+[ 120: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.RENDERBUFFER
+[ 121: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is renderbuffer
 [ 122: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE) is non-zero.
 [ 123: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE) is non-zero.
 [ 124: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE) is non-zero.
@@ -129,14 +129,14 @@
 [ 125: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING) is non-zero.
 [ 126: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE) is non-zero.
 [ 127: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING) is non-zero.
-[ 128: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_ENUM : after evaluating: gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)
+[ 128: PASS ] getError was expected value: INVALID_OPERATION : after evaluating: gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE)
 [ 129: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING) is non-zero.
-[ 130: FAIL ] getFramebufferAttachmentParameter did not generate INVALID_ENUM for invalid parameter enum: NO_ERROR
+[ 130: PASS ] getFramebufferAttachmentParameter correctly handled invalid parameter enums
 [ 131: PASS ] getFramebufferAttachmentParameter correctly handled invalid target enums
 [ 132: PASS ] getFramebufferAttachmentParameter correctly handled invalid attachment enums
 [ 133: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_COMPLETE
-[ 134: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) should be 33304. Was 5890.
-[ 135: FAIL ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) should be 33304. Was 0.
+[ 134: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.FRAMEBUFFER_DEFAULT
+[ 135: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.FRAMEBUFFER_DEFAULT
 [ 136: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.NONE
 [ 137: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_RED_SIZE) is non-zero.
 [ 138: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE) is non-zero.
@@ -270,15 +270,15 @@
 [ 266: PASS ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_TYPE) is gl.FLOAT
 [ 267: PASS ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED) is false
 [ 268: PASS ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_DIVISOR) is 0
-[ 269: FAIL ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_INTEGER) should be false (of type boolean). Was null (of type object).
+[ 269: PASS ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_INTEGER) is false
 [ 270: PASS ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_DIVISOR) is 2
 [ 271: PASS ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) is 36
 [ 272: PASS ] gl.getVertexAttribOffset(1, gl.VERTEX_ATTRIB_ARRAY_POINTER) is 12
 [ 273: PASS ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED) is false
 [ 274: PASS ] gl.getVertexAttrib(1, gl.CURRENT_VERTEX_ATTRIB) is [5, 6, 7, 8]
-[ 275: FAIL ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_TYPE) should be 5124. Was 5126.
-[ 276: FAIL ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_INTEGER) should be true (of type boolean). Was null (of type object).
-[ 277: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM :
+[ 275: PASS ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_TYPE) is gl.INT
+[ 276: PASS ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_INTEGER) is true
+[ 277: PASS ] getError was expected value: NO_ERROR :
 [ 278: PASS ] getVertexAttrib correctly handled invalid parameter enums
 [ 279: PASS ] getError was expected value: INVALID_VALUE : after evaluating: gl.getVertexAttrib(16, gl.CURRENT_VERTEX_ATTRIB)
 [ 280: PASS ] gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.NONE
@@ -365,4 +365,4 @@
 [ 361: PASS ] getActiveUniformBlockParameter correctly handled invalid pname enums
 [ 362: PASS ] getError was expected value: NO_ERROR :
 [ 363: PASS ] successfullyParsed is true
-[ FAIL ] 35 failures reported
+[ FAIL ] 14 failures reported

Modified: trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/fbostatequery-expected.txt (271443 => 271444)


--- trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/fbostatequery-expected.txt	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/fbostatequery-expected.txt	2021-01-13 18:56:35 UTC (rev 271444)
@@ -1,21 +1,4 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../../resources/webgl_test_files/deqp/functional/gles3/fbostatequery.html
-
-[ 1: FAIL ] fbo.draw_framebuffer_default_framebuffer:
-[ 2: FAIL ] fbo.read_framebuffer_default_framebuffer:
-[ 3: PASS ] fbo.framebuffer_attachment_object: Passed
-[ 4: PASS ] fbo.framebuffer_attachment_texture_level: Passed
-[ 5: PASS ] fbo.framebuffer_attachment_texture_cube_map_face: Passed
-[ 6: FAIL ] fbo.framebuffer_attachment_texture_layer:
-[ 7: PASS ] fbo.framebuffer_attachment_color_encoding: Passed
-[ 8: PASS ] fbo.framebuffer_attachment_component_type: Passed
-[ 9: PASS ] fbo.framebuffer_attachment_x_size_initial: Passed
-[ 10: PASS ] fbo.framebuffer_attachment_x_size_rbo: Passed
-[ 11: PASS ] fbo.framebuffer_attachment_x_size_texture: Passed
-[ 12: PASS ] fbo.framebuffer_unspecified_attachment_color_encoding: Passed
-[ 13: PASS ] fbo.framebuffer_unspecified_attachment_component_type: Passed
-[ 14: PASS ] fbo.framebuffer_unspecified_attachment_x_size_rbo: Passed
-[ 15: PASS ] fbo.framebuffer_unspecified_attachment_x_size_texture: Passed
-[ 16: PASS ] fbo.framebuffer_unspecified_attachment_x_size_texture: successfullyParsed is true
-[ FAIL ] 3 failures reported
+[ PASS ] All tests passed

Modified: trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/negativebufferapi-expected.txt (271443 => 271444)


--- trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/negativebufferapi-expected.txt	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/negativebufferapi-expected.txt	2021-01-13 18:56:35 UTC (rev 271444)
@@ -1,34 +1,4 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../../resources/webgl_test_files/deqp/functional/gles3/negativebufferapi.html
-
-[ 1: PASS ] negativeBufferApi.bind_buffer: Passed
-[ 2: PASS ] negativeBufferApi.buffer_data: Passed
-[ 3: PASS ] negativeBufferApi.buffer_sub_data: Passed
-[ 4: PASS ] negativeBufferApi.buffer_sub_data_size_offset: Passed
-[ 5: PASS ] negativeBufferApi.clear: Passed
-[ 6: PASS ] negativeBufferApi.read_pixels: Passed
-[ 7: PASS ] negativeBufferApi.read_pixels_format_mismatch: Passed
-[ 8: PASS ] negativeBufferApi.read_pixels_fbo_format_mismatch: Passed
-[ 9: PASS ] negativeBufferApi.bind_buffer_range: Passed
-[ 10: PASS ] negativeBufferApi.bind_buffer_base: Passed
-[ 11: PASS ] negativeBufferApi.clear_bufferiv: Passed
-[ 12: PASS ] negativeBufferApi.clear_bufferuiv: Passed
-[ 13: PASS ] negativeBufferApi.clear_bufferfv: Passed
-[ 14: PASS ] negativeBufferApi.clear_bufferfi: Passed
-[ 15: FAIL ] negativeBufferApi.copy_buffer_sub_data: Expected gl.INVALID_OPERATION, but got gl.INVALID_VALUE.
-[ 16: FAIL ] negativeBufferApi.draw_buffers: Expected gl.NO_ERROR, but got gl.INVALID_OPERATION.
-[ 17: PASS ] negativeBufferApi.bind_framebuffer: Passed
-[ 18: PASS ] negativeBufferApi.bind_renderbuffer: Passed
-[ 19: PASS ] negativeBufferApi.check_framebuffer_status: Passed
-[ 20: PASS ] negativeBufferApi.framebuffer_renderbuffer: Passed
-[ 21: PASS ] negativeBufferApi.framebuffer_texture2d: Passed
-[ 22: FAIL ] negativeBufferApi.renderbuffer_storage: Expected gl.INVALID_VALUE, but got gl.NO_ERROR.
-[ 23: PASS ] negativeBufferApi.blit_framebuffer: Passed
-[ 24: PASS ] negativeBufferApi.blit_framebuffer_multisample: Passed
-[ 25: PASS ] negativeBufferApi.framebuffer_texture_layer: Passed
-[ 26: PASS ] negativeBufferApi.invalidate_framebuffer: Passed
-[ 27: PASS ] negativeBufferApi.invalidate_sub_framebuffer: Passed
-[ 28: FAIL ] negativeBufferApi.renderbuffer_storage_multisample: Expected gl.INVALID_VALUE, but got gl.NO_ERROR.
-[ 29: PASS ] successfullyParsed is true
-[ FAIL ] 4 failures reported
+[ PASS ] All tests passed

Modified: trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/negativevertexarrayapi-expected.txt (271443 => 271444)


--- trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/negativevertexarrayapi-expected.txt	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/negativevertexarrayapi-expected.txt	2021-01-13 18:56:35 UTC (rev 271444)
@@ -1,30 +1,4 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../../resources/webgl_test_files/deqp/functional/gles3/negativevertexarrayapi.html
-
-[ 1: PASS ] vertex_array.vertex_attribf: Passed
-[ 2: PASS ] vertex_array.vertex_attribfv: Passed
-[ 3: PASS ] vertex_array.vertex_attribi4: Passed
-[ 4: PASS ] vertex_array.vertex_attribi4v: Passed
-[ 5: PASS ] vertex_array.vertex_attrib_pointer: Passed
-[ 6: PASS ] vertex_array.vertex_attrib_i_pointer: Passed
-[ 7: PASS ] vertex_array.enable_vertex_attrib_array: Passed
-[ 8: PASS ] vertex_array.disable_vertex_attrib_array: Passed
-[ 9: PASS ] vertex_array.vertex_attrib_divisor: Passed
-[ 10: PASS ] vertex_array.draw_arrays: Passed
-[ 11: PASS ] vertex_array.draw_arrays_invalid_program: Passed
-[ 12: PASS ] vertex_array.draw_arrays_incomplete_primitive: Passed
-[ 13: PASS ] vertex_array.draw_elements: Passed
-[ 14: PASS ] vertex_array.draw_elements_invalid_program: Passed
-[ 15: PASS ] vertex_array.draw_elements_incomplete_primitive: Passed
-[ 16: PASS ] vertex_array.draw_arrays_instanced: Passed
-[ 17: PASS ] vertex_array.draw_arrays_instanced_invalid_program: Passed
-[ 18: PASS ] vertex_array.draw_arrays_instanced_incomplete_primitive: Passed
-[ 19: FAIL ] vertex_array.draw_elements_instanced: Expected gl.INVALID_VALUE, but got gl.NO_ERROR.
-[ 20: PASS ] vertex_array.draw_elements_instanced_invalid_program: Passed
-[ 21: FAIL ] vertex_array.draw_elements_instanced_incomplete_primitive: Expected gl.INVALID_VALUE, but got gl.NO_ERROR.
-[ 22: PASS ] vertex_array.draw_range_elements: Passed
-[ 23: PASS ] vertex_array.draw_range_elements_invalid_program: Passed
-[ 24: PASS ] vertex_array.draw_range_elements_incomplete_primitive: Passed
-[ 25: PASS ] vertex_array.draw_range_elements_incomplete_primitive: successfullyParsed is true
-[ FAIL ] 2 failures reported
+[ PASS ] All tests passed

Modified: trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/shaderstatequery-expected.txt (271443 => 271444)


--- trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/shaderstatequery-expected.txt	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/LayoutTests/webgl/2.0.0/deqp/functional/gles3/shaderstatequery-expected.txt	2021-01-13 18:56:35 UTC (rev 271444)
@@ -1,51 +1,4 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../../resources/webgl_test_files/deqp/functional/gles3/shaderstatequery.html
-
-[ 1: PASS ] shader.shader_type: Passed
-[ 2: PASS ] shader.shader_compile_status: Passed
-[ 3: PASS ] shader.shader_info_log: Passed
-[ 4: PASS ] shader.shader_source: Passed
-[ 5: FAIL ] shader.delete_status:
-[ 6: PASS ] shader.current_vertex_attrib_initial: Passed
-[ 7: PASS ] shader.current_vertex_attrib_float: Passed
-[ 8: PASS ] shader.current_vertex_attrib_int: Passed
-[ 9: PASS ] shader.current_vertex_attrib_uint: Passed
-[ 10: PASS ] shader.program_info_log: Passed
-[ 11: PASS ] shader.program_validate_status: Passed
-[ 12: PASS ] shader.program_attached_shaders: Passed
-[ 13: PASS ] shader.program_active_uniform_name: Passed
-[ 14: PASS ] shader.program_active_uniform_types: Passed
-[ 15: FAIL ] shader.program_active_uniform_blocks: Expected { 1, 2}; got {1, 2}
-[ 16: PASS ] shader.transform_feedback: Passed
-[ 17: PASS ] shader.active_attributes: Passed
-[ 18: PASS ] shader.vertex_attrib_size: Passed
-[ 19: FAIL ] shader.vertex_attrib_type:
-[ 20: FAIL ] shader.vertex_attrib_stride:
-[ 21: FAIL ] shader.vertex_attrib_normalized:
-[ 22: FAIL ] shader.vertex_attrib_integer:
-[ 23: PASS ] shader.vertex_attrib_array_enabled: Passed
-[ 24: PASS ] shader.vertex_attrib_array_divisor: Passed
-[ 25: PASS ] shader.vertex_attrib_array_buffer_binding: Passed
-[ 26: PASS ] shader.vertex_attrib_offset: Passed
-[ 27: PASS ] shader.uniform_value_float: Passed
-[ 28: PASS ] shader.uniform_value_int: Passed
-[ 29: PASS ] shader.uniform_value_uint: Passed
-[ 30: PASS ] shader.uniform_value_boolean: Passed
-[ 31: PASS ] shader.uniform_value_sampler: Passed
-[ 32: PASS ] shader.uniform_value_array: Passed
-[ 33: PASS ] shader.uniform_value_matrix: Passed
-[ 34: PASS ] shader.precision_vertex_lowp_float: Passed
-[ 35: PASS ] shader.precision_vertex_mediump_float: Passed
-[ 36: PASS ] shader.precision_vertex_highp_float: Passed
-[ 37: PASS ] shader.precision_vertex_lowp_int: Passed
-[ 38: PASS ] shader.precision_vertex_mediump_int: Passed
-[ 39: PASS ] shader.precision_vertex_highp_int: Passed
-[ 40: PASS ] shader.precision_fragment_lowp_float: Passed
-[ 41: PASS ] shader.precision_fragment_mediump_float: Passed
-[ 42: PASS ] shader.precision_fragment_highp_float: Passed
-[ 43: PASS ] shader.precision_fragment_lowp_int: Passed
-[ 44: PASS ] shader.precision_fragment_mediump_int: Passed
-[ 45: PASS ] shader.precision_fragment_highp_int: Passed
-[ 46: PASS ] shader.precision_fragment_highp_int: successfullyParsed is true
-[ FAIL ] 6 failures reported
+[ PASS ] All tests passed

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (271443 => 271444)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-01-13 18:56:35 UTC (rev 271444)
@@ -1,3 +1,18 @@
+2021-01-13  Kenneth Russell  <[email protected]>
+
+        [WebGL2] fbostatequery, negativebufferapi, negativevertexarrayapi, shaderstatequery conformance failures
+        https://bugs.webkit.org/show_bug.cgi?id=220372
+
+        Reviewed by Darin Adler.
+
+        Add a needed early-out in drawArraysInstanced validation when the
+        primitive count is zero. This patch will be upstreamed to ANGLE
+        afterward.
+
+        * src/libANGLE/validationES.h:
+        (gl::ValidateDrawArraysAttribs):
+        (gl::ValidateDrawArraysCommon):
+
 2021-01-08  Kyle Piddington  <[email protected]>
 
         Failures of attribute location conformance tests with Metal backend

Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/validationES.h (271443 => 271444)


--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/validationES.h	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/validationES.h	2021-01-13 18:56:35 UTC (rev 271444)
@@ -791,7 +791,7 @@
     return true;
 }
 
-ANGLE_INLINE bool ValidateDrawArraysAttribs(const Context *context, GLint first, GLsizei count)
+ANGLE_INLINE bool ValidateDrawArraysAttribs(const Context *context, GLint first, GLsizei count, GLsizei primcount)
 {
     if (!context->isBufferAccessValidationEnabled())
     {
@@ -811,6 +811,12 @@
         return false;
     }
 
+    if (primcount == 0)
+    {
+        // Skip the specific validation of the non-instanced vertex element limit.
+        return true;
+    }
+
     return ValidateDrawAttribs(context, maxVertex);
 }
 
@@ -870,7 +876,7 @@
         }
     }
 
-    return ValidateDrawArraysAttribs(context, first, count);
+    return ValidateDrawArraysAttribs(context, first, count, primcount);
 }
 
 ANGLE_INLINE bool ValidateDrawElementsBase(const Context *context,

Modified: trunk/Source/WebCore/ChangeLog (271443 => 271444)


--- trunk/Source/WebCore/ChangeLog	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/Source/WebCore/ChangeLog	2021-01-13 18:56:35 UTC (rev 271444)
@@ -1,3 +1,103 @@
+2021-01-13  Kenneth Russell  <[email protected]>
+
+        [WebGL2] fbostatequery, negativebufferapi, negativevertexarrayapi, shaderstatequery conformance failures
+        https://bugs.webkit.org/show_bug.cgi?id=220372
+
+        Reviewed by Darin Adler.
+
+        Fix validation of program and shader objects to address
+        conformance test failures. Unify and clean up validation of some
+        other object types.
+
+        Fix bugs in queries of framebuffer attachments and integer vertex
+        attributes.
+
+        Remove an old macOS workaround from GraphicsContextGLANGLE which
+        was causing test failures of maximum renderbuffer sizes.
+
+        Generate tests' expected OpenGL errors for a few APIs.
+
+        Covered by existing WebGL 2.0 conformance tests.
+
+        * html/canvas/WebGL2RenderingContext.cpp:
+        (WebCore::WebGL2RenderingContext::copyBufferSubData):
+        (WebCore::WebGL2RenderingContext::bindFramebuffer):
+        (WebCore::WebGL2RenderingContext::getFragDataLocation):
+        (WebCore::WebGL2RenderingContext::vertexAttribIPointer):
+        (WebCore::WebGL2RenderingContext::drawBuffers):
+        (WebCore::WebGL2RenderingContext::isQuery):
+        (WebCore::WebGL2RenderingContext::beginQuery):
+        (WebCore::WebGL2RenderingContext::getQueryParameter):
+        (WebCore::WebGL2RenderingContext::isSampler):
+        (WebCore::WebGL2RenderingContext::isSync):
+        (WebCore::WebGL2RenderingContext::deleteSync):
+        (WebCore::WebGL2RenderingContext::clientWaitSync):
+        (WebCore::WebGL2RenderingContext::waitSync):
+        (WebCore::WebGL2RenderingContext::getSyncParameter):
+        (WebCore::WebGL2RenderingContext::deleteTransformFeedback):
+        (WebCore::WebGL2RenderingContext::isTransformFeedback):
+        (WebCore::WebGL2RenderingContext::bindTransformFeedback):
+        (WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
+        (WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
+        (WebCore::WebGL2RenderingContext::setIndexedBufferBinding):
+        (WebCore::WebGL2RenderingContext::getUniformIndices):
+        (WebCore::WebGL2RenderingContext::getActiveUniforms):
+        (WebCore::WebGL2RenderingContext::getUniformBlockIndex):
+        (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
+        (WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
+        (WebCore::WebGL2RenderingContext::uniformBlockBinding):
+        (WebCore::WebGL2RenderingContext::deleteVertexArray):
+        (WebCore::WebGL2RenderingContext::isVertexArray):
+        (WebCore::WebGL2RenderingContext::bindVertexArray):
+        (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
+        * html/canvas/WebGLObject.cpp:
+        (WebCore::WebGLObject::deleteObject):
+        * html/canvas/WebGLObject.h:
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::attachShader):
+        (WebCore::WebGLRenderingContextBase::bindAttribLocation):
+        (WebCore::WebGLRenderingContextBase::validateNullableWebGLObject):
+        (WebCore::WebGLRenderingContextBase::bindBuffer):
+        (WebCore::WebGLRenderingContextBase::bindFramebuffer):
+        (WebCore::WebGLRenderingContextBase::bindRenderbuffer):
+        (WebCore::WebGLRenderingContextBase::bindTexture):
+        (WebCore::WebGLRenderingContextBase::compileShader):
+        (WebCore::WebGLRenderingContextBase::detachShader):
+        (WebCore::WebGLRenderingContextBase::validateWebGLObject):
+        (WebCore::WebGLRenderingContextBase::validateWebGLProgramOrShader):
+        (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
+        (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
+        (WebCore::WebGLRenderingContextBase::getActiveAttrib):
+        (WebCore::WebGLRenderingContextBase::getActiveUniform):
+        (WebCore::WebGLRenderingContextBase::getAttachedShaders):
+        (WebCore::WebGLRenderingContextBase::getAttribLocation):
+        (WebCore::WebGLRenderingContextBase::getProgramInfoLog):
+        (WebCore::WebGLRenderingContextBase::getShaderInfoLog):
+        (WebCore::WebGLRenderingContextBase::getShaderSource):
+        (WebCore::WebGLRenderingContextBase::getUniform):
+        (WebCore::WebGLRenderingContextBase::getUniformLocation):
+        (WebCore::WebGLRenderingContextBase::getVertexAttrib):
+        (WebCore::WebGLRenderingContextBase::isBuffer):
+        (WebCore::WebGLRenderingContextBase::isFramebuffer):
+        (WebCore::WebGLRenderingContextBase::isProgram):
+        (WebCore::WebGLRenderingContextBase::isRenderbuffer):
+        (WebCore::WebGLRenderingContextBase::isShader):
+        (WebCore::WebGLRenderingContextBase::isTexture):
+        (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
+        (WebCore::WebGLRenderingContextBase::shaderSource):
+        (WebCore::WebGLRenderingContextBase::useProgram):
+        (WebCore::WebGLRenderingContextBase::validateProgram):
+        (WebCore::WebGLRenderingContextBase::vertexAttribPointer):
+        (WebCore::WebGLRenderingContextBase::drawArraysInstanced):
+        (WebCore::WebGLRenderingContextBase::drawElementsInstanced):
+        (WebCore::WebGLRenderingContextBase::checkObjectToBeBound): Deleted.
+        * html/canvas/WebGLRenderingContextBase.h:
+        * html/canvas/WebGLVertexArrayObjectBase.cpp:
+        (WebCore::WebGLVertexArrayObjectBase::setVertexAttribState):
+        * html/canvas/WebGLVertexArrayObjectBase.h:
+        * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
+        (WebCore::GraphicsContextGLOpenGL::getIntegerv):
+
 2021-01-13  Rob Buis  <[email protected]>
 
         Null check native image in createBitmapImageAfterScalingIfNeeded

Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (271443 => 271444)


--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2021-01-13 18:56:35 UTC (rev 271444)
@@ -581,7 +581,7 @@
     RefPtr<WebGLBuffer> readBuffer = validateBufferDataParameters("copyBufferSubData", readTarget, GraphicsContextGL::STATIC_DRAW);
     RefPtr<WebGLBuffer> writeBuffer = validateBufferDataParameters("copyBufferSubData", writeTarget, GraphicsContextGL::STATIC_DRAW);
     if (!readBuffer || !writeBuffer) {
-        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "copyBufferSubData", "Invalid readTarget or writeTarget");
+        synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "copyBufferSubData", "Invalid readTarget or writeTarget");
         return;
     }
 
@@ -689,7 +689,7 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (!checkObjectToBeBound("bindFramebuffer", buffer))
+    if (!validateNullableWebGLObject("bindFramebuffer", buffer))
         return;
 
     switch (target) {
@@ -1493,7 +1493,7 @@
 
 GCGLint WebGL2RenderingContext::getFragDataLocation(WebGLProgram& program, const String& name)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getFragDataLocation", &program))
+    if (!validateWebGLProgramOrShader("getFragDataLocation", &program))
         return -1;
     return m_context->getFragDataLocation(program.object(), name);
 }
@@ -1704,9 +1704,57 @@
 
 void WebGL2RenderingContext::vertexAttribIPointer(GCGLuint index, GCGLint size, GCGLenum type, GCGLsizei stride, GCGLint64 offset)
 {
+    auto locker = holdLock(objectGraphLock());
+
     if (isContextLostOrPending())
         return;
 
+    switch (type) {
+    case GraphicsContextGL::BYTE:
+    case GraphicsContextGL::UNSIGNED_BYTE:
+    case GraphicsContextGL::SHORT:
+    case GraphicsContextGL::UNSIGNED_SHORT:
+    case GraphicsContextGL::FLOAT:
+    case GraphicsContextGL::INT:
+    case GraphicsContextGL::UNSIGNED_INT:
+        break;
+    default:
+        synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "vertexAttribIPointer", "invalid type");
+        return;
+    }
+    if (index >= m_maxVertexAttribs) {
+        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "vertexAttribIPointer", "index out of range");
+        return;
+    }
+    if (size < 1 || size > 4) {
+        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "vertexAttribIPointer", "bad size");
+        return;
+    }
+    if (stride < 0 || stride > 255) {
+        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "vertexAttribIPointer", "bad stride");
+        return;
+    }
+    if (offset < 0 || offset > std::numeric_limits<int32_t>::max()) {
+        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "vertexAttribIPointer", "bad offset");
+        return;
+    }
+    if (!m_boundArrayBuffer && offset) {
+        synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "vertexAttribIPointer", "no bound ARRAY_BUFFER");
+        return;
+    }
+    // Determine the number of elements the bound buffer can hold, given the offset, size, type and stride.
+    auto typeSize = sizeInBytes(type);
+    if (!typeSize) {
+        synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "vertexAttribIPointer", "invalid type");
+        return;
+    }
+    if ((stride % typeSize) || (static_cast<GCGLintptr>(offset) % typeSize)) {
+        synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "vertexAttribIPointer", "stride or offset not valid for type");
+        return;
+    }
+    GCGLsizei bytesPerElement = size * typeSize;
+
+    m_boundVertexArrayObject->setVertexAttribState(locker, index, bytesPerElement, size, type, false, stride, static_cast<GCGLintptr>(offset), true, m_boundArrayBuffer.get());
     m_context->vertexAttribIPointer(index, size, type, stride, offset);
 }
 
@@ -1748,9 +1796,24 @@
         return;
     GCGLsizei n = buffers.size();
     const GCGLenum* bufs = buffers.data();
+    for (GCGLsizei i = 0; i < n; ++i) {
+        switch (bufs[i]) {
+        case GraphicsContextGL::NONE:
+        case GraphicsContextGL::BACK:
+        case GraphicsContextGL::COLOR_ATTACHMENT0:
+            continue;
+        default:
+            if (bufs[i] > GraphicsContextGL::COLOR_ATTACHMENT0
+                && bufs[i] < GraphicsContextGL::COLOR_ATTACHMENT0 + getMaxColorAttachments()) {
+                continue;
+            }
+            synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "drawBuffers", "invalid buffer");
+            return;
+        }
+    }
     if (!m_framebufferBinding) {
         if (n != 1) {
-            synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "drawBuffers", "more than one buffer");
+            synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "drawBuffers", "more than one buffer");
             return;
         }
         if (bufs[0] != GraphicsContextGL::BACK && bufs[0] != GraphicsContextGL::NONE) {
@@ -1853,8 +1916,12 @@
 
 GCGLboolean WebGL2RenderingContext::isQuery(WebGLQuery* query)
 {
-    if (isContextLostOrPending() || !query || !query->object() || !validateWebGLObject("isQuery", query))
+    if (isContextLostOrPending() || !query || !query->validate(contextGroup(), *this))
         return false;
+
+    if (query->isDeleted())
+        return false;
+
     return m_context->isQuery(query->object());
 }
 
@@ -1874,7 +1941,7 @@
     auto locker = holdLock(objectGraphLock());
 
     GCGLenum targetKey;
-    if (isContextLostOrPending() || !validateWebGLObject("beginQuery", &query) || !validateQueryTarget("beginQuery", target, &targetKey))
+    if (!validateWebGLObject("beginQuery", &query) || !validateQueryTarget("beginQuery", target, &targetKey))
         return;
 
     if (query.target() && query.target() != target) {
@@ -1935,7 +2002,7 @@
 
 WebGLAny WebGL2RenderingContext::getQueryParameter(WebGLQuery& query, GCGLenum pname)
 {
-    if (isContextLostOrPending() || !validateWebGLObject("getQueryParameter", &query))
+    if (!validateWebGLObject("getQueryParameter", &query))
         return nullptr;
 
     switch (pname) {
@@ -1985,7 +2052,7 @@
 
 GCGLboolean WebGL2RenderingContext::isSampler(WebGLSampler* sampler)
 {
-    if (isContextLostOrPending() || !sampler || sampler->isDeleted() || !validateWebGLObject("isSampler", sampler))
+    if (isContextLostOrPending() || !sampler || !sampler->validate(contextGroup(), *this) || sampler->isDeleted())
         return false;
 
     return m_context->isSampler(sampler->object());
@@ -2074,7 +2141,13 @@
 
 GCGLboolean WebGL2RenderingContext::isSync(WebGLSync* sync)
 {
-    return !isContextLostOrPending() && sync && !sync->isDeleted() && validateWebGLObject("isSync", sync);
+    if (isContextLostOrPending() || !sync || !sync->validate(contextGroup(), *this))
+        return false;
+
+    if (sync->isDeleted())
+        return false;
+
+    return !!sync->object();
 }
 
 void WebGL2RenderingContext::deleteSync(WebGLSync* sync)
@@ -2081,14 +2154,12 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (isContextLostOrPending() || !sync || sync->isDeleted() || !validateWebGLObject("deleteSync", sync))
-        return;
     deleteObject(locker, sync);
 }
 
 GCGLenum WebGL2RenderingContext::clientWaitSync(WebGLSync& sync, GCGLbitfield flags, GCGLuint64 timeout)
 {
-    if (isContextLostOrPending() || !validateWebGLObject("clientWaitSync", &sync))
+    if (!validateWebGLObject("clientWaitSync", &sync))
         return GraphicsContextGL::WAIT_FAILED_WEBGL;
 
     if (timeout > MaxClientWaitTimeout) {
@@ -2111,7 +2182,7 @@
 
 void WebGL2RenderingContext::waitSync(WebGLSync& sync, GCGLbitfield flags, GCGLint64 timeout)
 {
-    if (isContextLostOrPending() || !validateWebGLObject("waitSync", &sync))
+    if (!validateWebGLObject("waitSync", &sync))
         return;
 
     if (flags)
@@ -2124,7 +2195,7 @@
 
 WebGLAny WebGL2RenderingContext::getSyncParameter(WebGLSync& sync, GCGLenum pname)
 {
-    if (isContextLostOrPending() || !validateWebGLObject("getSyncParameter", &sync))
+    if (!validateWebGLObject("getSyncParameter", &sync))
         return nullptr;
 
     switch (pname) {
@@ -2154,27 +2225,34 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (isContextLostOrPending() || !feedbackObject || feedbackObject->isDeleted() || !validateWebGLObject("deleteTransformFeedback", feedbackObject))
-        return;
-    
+    // We have to short-circuit the deletion process if the transform feedback is
+    // active. This requires duplication of some validation logic.
+    if (isContextLostOrPending() && feedbackObject && feedbackObject->validate(contextGroup(), *this)) {
+        if (feedbackObject->isActive()) {
+            synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "deleteTransformFeedback", "attempt to delete an active transform feedback object");
+            return;
+        }
+    }
+
     ASSERT(feedbackObject != m_defaultTransformFeedback);
-    
-    if (feedbackObject->isActive()) {
-        synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "deleteTransformFeedback", "attempt to delete an active transform feedback object");
+
+    if (!deleteObject(locker, feedbackObject))
         return;
-    }
 
     if (m_boundTransformFeedback == feedbackObject)
         m_boundTransformFeedback = m_defaultTransformFeedback;
-
-    deleteObject(locker, feedbackObject);
 }
 
 GCGLboolean WebGL2RenderingContext::isTransformFeedback(WebGLTransformFeedback* feedbackObject)
 {
-    if (isContextLostOrPending() || !feedbackObject || feedbackObject->isDeleted() || !validateWebGLObject("isTransformFeedback", feedbackObject))
+    if (isContextLostOrPending() || !feedbackObject || !feedbackObject->validate(contextGroup(), *this))
         return false;
 
+    if (!feedbackObject->hasEverBeenBound())
+        return false;
+    if (feedbackObject->isDeleted())
+        return false;
+
     return m_context->isTransformFeedback(feedbackObject->object());
 }
 
@@ -2182,19 +2260,9 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (isContextLostOrPending())
+    if (!validateNullableWebGLObject("bindTransformFeedback", feedbackObject))
         return;
 
-    if (feedbackObject) {
-        if (feedbackObject->isDeleted()) {
-            synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "bindTransformFeedback", "cannot bind a deleted Transform Feedback object");
-            return;
-        }
-
-        if (!validateWebGLObject("bindTransformFeedback", feedbackObject))
-            return;
-    }
-
     if (target != GraphicsContextGL::TRANSFORM_FEEDBACK) {
         synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "bindTransformFeedback", "target must be TRANSFORM_FEEDBACK");
         return;
@@ -2205,6 +2273,7 @@
     }
 
     auto toBeBound = feedbackObject ? feedbackObject : m_defaultTransformFeedback.get();
+    toBeBound->setHasEverBeenBound();
     m_context->bindTransformFeedback(target, toBeBound->object());
     m_boundTransformFeedback = toBeBound;
 }
@@ -2274,7 +2343,7 @@
 
 void WebGL2RenderingContext::transformFeedbackVaryings(WebGLProgram& program, const Vector<String>& varyings, GCGLenum bufferMode)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("transformFeedbackVaryings", &program))
+    if (!validateWebGLProgramOrShader("transformFeedbackVaryings", &program))
         return;
     
     switch (bufferMode) {
@@ -2297,7 +2366,7 @@
 
 RefPtr<WebGLActiveInfo> WebGL2RenderingContext::getTransformFeedbackVarying(WebGLProgram& program, GCGLuint index)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getTransformFeedbackVarying", &program))
+    if (!validateWebGLProgramOrShader("getTransformFeedbackVarying", &program))
         return nullptr;
 
     GraphicsContextGL::ActiveInfo info;
@@ -2350,12 +2419,9 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (isContextLostOrPending())
+    if (!validateNullableWebGLObject(functionName, buffer))
         return false;
 
-    if (!checkObjectToBeBound(functionName, buffer))
-        return false;
-
     switch (target) {
     case GraphicsContextGL::TRANSFORM_FEEDBACK_BUFFER:
         if (index >= m_maxTransformFeedbackSeparateAttribs) {
@@ -2445,21 +2511,14 @@
 
 Optional<Vector<GCGLuint>> WebGL2RenderingContext::getUniformIndices(WebGLProgram& program, const Vector<String>& names)
 {
-#if USE(ANGLE)
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getUniformIndices", &program))
+    if (!validateWebGLProgramOrShader("getUniformIndices", &program))
         return WTF::nullopt;
     return m_context->getUniformIndices(program.object(), names);
-#else
-    LOG(WebGL, "[[ NOT IMPLEMENTED ]] getUniformIndices()");
-    UNUSED_PARAM(program);
-    UNUSED_PARAM(names);
-    return WTF::nullopt;
-#endif
 }
 
 WebGLAny WebGL2RenderingContext::getActiveUniforms(WebGLProgram& program, const Vector<GCGLuint>& uniformIndices, GCGLenum pname)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getActiveUniforms", &program))
+    if (!validateWebGLProgramOrShader("getActiveUniforms", &program))
         return nullptr;
 
     switch (pname) {
@@ -2488,22 +2547,14 @@
 
 GCGLuint WebGL2RenderingContext::getUniformBlockIndex(WebGLProgram& program, const String& uniformBlockName)
 {
-#if USE(ANGLE)
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getUniformBlockIndex", &program))
+    if (!validateWebGLProgramOrShader("getUniformBlockIndex", &program))
         return 0;
     return m_context->getUniformBlockIndex(program.object(), uniformBlockName);
-#else
-    UNUSED_PARAM(program);
-    UNUSED_PARAM(uniformBlockName);
-    LOG(WebGL, "[[ NOT IMPLEMENTED ]] getUniformBlockIndex()");
-    return 0;
-#endif
 }
 
 WebGLAny WebGL2RenderingContext::getActiveUniformBlockParameter(WebGLProgram& program, GCGLuint uniformBlockIndex, GCGLenum pname)
 {
-#if USE(ANGLE)
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getActiveUniformBlockParameter", &program))
+    if (!validateWebGLProgramOrShader("getActiveUniformBlockParameter", &program))
         return nullptr;
     switch (pname) {
     case GraphicsContextGL::UNIFORM_BLOCK_BINDING:
@@ -2514,7 +2565,7 @@
         GCGLint size = m_context->getActiveUniformBlocki(program.object(), uniformBlockIndex, GraphicsContextGL::UNIFORM_BLOCK_ACTIVE_UNIFORMS);
         Vector<GCGLint> params(size, 0);
         m_context->getActiveUniformBlockiv(program.object(), uniformBlockIndex, pname, params);
-        return params.map([](auto x) { return static_cast<GCGLuint>(x); });
+        return Uint32Array::tryCreate(reinterpret_cast<GCGLuint*>(params.data()), params.size());
     }
     case GraphicsContextGL::UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:
     case GraphicsContextGL::UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:
@@ -2523,19 +2574,11 @@
         synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getActiveUniformBlockParameter", "invalid parameter name");
         return nullptr;
     }
-#else
-    UNUSED_PARAM(program);
-    UNUSED_PARAM(uniformBlockIndex);
-    UNUSED_PARAM(pname);
-    LOG(WebGL, "[[ NOT IMPLEMENTED ]] getActiveUniformBlockParameter()");
-    return nullptr;
-#endif
 }
 
 WebGLAny WebGL2RenderingContext::getActiveUniformBlockName(WebGLProgram& program, GCGLuint index)
 {
-#if USE(ANGLE)
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getActiveUniformBlockName", &program))
+    if (!validateWebGLProgramOrShader("getActiveUniformBlockName", &program))
         return String();
     if (!program.getLinkStatus()) {
         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "getActiveUniformBlockName", "program not linked");
@@ -2545,26 +2588,13 @@
     if (name.isNull())
         return nullptr;
     return name;
-#else
-    UNUSED_PARAM(program);
-    UNUSED_PARAM(index);
-    LOG(WebGL, "[[ NOT IMPLEMENTED ]] getActiveUniformBlockName()");
-    return nullptr;
-#endif
 }
 
 void WebGL2RenderingContext::uniformBlockBinding(WebGLProgram& program, GCGLuint uniformBlockIndex, GCGLuint uniformBlockBinding)
 {
-#if USE(ANGLE)
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("uniformBlockBinding", &program))
+    if (!validateWebGLProgramOrShader("uniformBlockBinding", &program))
         return;
     m_context->uniformBlockBinding(program.object(), uniformBlockIndex, uniformBlockBinding);
-#else
-    UNUSED_PARAM(program);
-    UNUSED_PARAM(uniformBlockIndex);
-    UNUSED_PARAM(uniformBlockBinding);
-    LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniformBlockBinding()");
-#endif
 }
 
 RefPtr<WebGLVertexArrayObject> WebGL2RenderingContext::createVertexArray()
@@ -2581,21 +2611,24 @@
 {
     auto locker = holdLock(objectGraphLock());
 
+    // validateWebGLObject generates an error if the object has already been
+    // deleted, so we must replicate most of its checks here.
     if (!arrayObject || isContextLost())
         return;
 
+    if (!arrayObject->validate(contextGroup(), *this)) {
+        synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "deleteVertexArray", "object does not belong to this context");
+        return;
+    }
+
     if (arrayObject->isDeleted())
         return;
 
     if (!arrayObject->isDefaultObject() && arrayObject == m_boundVertexArrayObject) {
-#if USE(OPENGL_ES)
-        setBoundVertexArrayObject(locker, nullptr);
-#else
         // bindVertexArray grabs the lock internally.
         locker.unlockEarly();
         bindVertexArray(nullptr); // The default VAO was removed in OpenGL 3.3 but not from WebGL 2; bind the default for WebGL to use.
         locker = holdLock(objectGraphLock());
-#endif
     }
 
     arrayObject->deleteObject(locker, graphicsContextGL());
@@ -2603,11 +2636,13 @@
 
 GCGLboolean WebGL2RenderingContext::isVertexArray(WebGLVertexArrayObject* arrayObject)
 {
-    if (!arrayObject || isContextLost())
+    if (!arrayObject || isContextLost() || !arrayObject->validate(0, *this))
         return false;
 
-    if (!arrayObject->hasEverBeenBound() || !arrayObject->validate(0, *this))
+    if (!arrayObject->hasEverBeenBound())
         return false;
+    if (arrayObject->isDeleted())
+        return false;
 
     return m_context->isVertexArray(arrayObject->object());
 }
@@ -2616,13 +2651,9 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (isContextLost())
+    if (!validateNullableWebGLObject("bindVertexArray", arrayObject))
         return;
 
-    if (arrayObject && (arrayObject->isDeleted() || !arrayObject->validate(0, *this) || !m_contextObjects.contains(arrayObject))) {
-        m_context->synthesizeGLError(GraphicsContextGL::INVALID_OPERATION);
-        return;
-    }
     if (arrayObject && !arrayObject->isDefaultObject() && arrayObject->object()) {
         m_context->bindVertexArray(arrayObject->object());
 
@@ -2747,18 +2778,48 @@
     auto targetFramebuffer = (target == GraphicsContextGL::READ_FRAMEBUFFER) ? m_readFramebufferBinding : m_framebufferBinding;
 
     if (!targetFramebuffer) {
-        // OpenGL ES 3: Default framebuffer is bound.
         if (!validateDefaultFramebufferAttachment(attachment)) {
             synthesizeGLError(GraphicsContextGL::INVALID_ENUM, functionName, "invalid attachment");
             return nullptr;
         }
-        return m_context->getFramebufferAttachmentParameteri(target, attachment, pname);
+
+        // We can look directly at m_attributes because in WebGL 2,
+        // they are required to be honored.
+        bool hasDepth = m_attributes.depth;
+        bool hasStencil = m_attributes.stencil;
+        bool missingImage = (attachment == GraphicsContextGL::DEPTH && !hasDepth) || (attachment == GraphicsContextGL::STENCIL && !hasStencil);
+        if (missingImage) {
+            switch (pname) {
+            case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
+                return static_cast<unsigned>(GraphicsContextGL::NONE);
+            default:
+                synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, functionName, "invalid parameter name");
+                return nullptr;
+            }
+        }
+
+        switch (pname) {
+        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
+            return GraphicsContextGL::FRAMEBUFFER_DEFAULT;
+        default:
+            return m_context->getFramebufferAttachmentParameteri(target, attachment, pname);
+        }
     }
     if (!validateNonDefaultFramebufferAttachment(functionName, attachment))
         return nullptr;
 
-    auto object = makeRefPtr(targetFramebuffer->getAttachmentObject(attachment));
-    if (!object) {
+    RefPtr<WebGLSharedObject> attachmentObject;
+    if (attachment == GraphicsContextGL::DEPTH_STENCIL_ATTACHMENT) {
+        attachmentObject = makeRefPtr(targetFramebuffer->getAttachmentObject(GraphicsContextGL::DEPTH_ATTACHMENT));
+        auto stencilAttachment = makeRefPtr(targetFramebuffer->getAttachmentObject(GraphicsContextGL::STENCIL_ATTACHMENT));
+        if (attachmentObject != stencilAttachment) {
+            synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, functionName, "different objects bound to DEPTH_ATTACHMENT and STENCIL_ATTACHMENT");
+            return nullptr;
+        }
+    } else
+        attachmentObject = makeRefPtr(targetFramebuffer->getAttachmentObject(attachment));
+
+    if (!attachmentObject) {
         if (pname == GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)
             return static_cast<unsigned>(GraphicsContextGL::NONE);
         if (pname == GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)
@@ -2768,6 +2829,20 @@
     }
 
     switch (pname) {
+    case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
+        if (attachmentObject->isTexture())
+            return static_cast<unsigned>(GraphicsContextGL::TEXTURE);
+        return static_cast<unsigned>(GraphicsContextGL::RENDERBUFFER);
+    case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
+        if (attachmentObject->isTexture())
+            return makeRefPtr(reinterpret_cast<WebGLTexture&>(*attachmentObject));
+        return makeRefPtr(reinterpret_cast<WebGLRenderbuffer&>(*attachmentObject));
+    case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
+    case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:
+    case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
+        if (!attachmentObject->isTexture())
+            break;
+        FALLTHROUGH;
     case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_RED_SIZE:
     case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
     case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
@@ -2774,47 +2849,18 @@
     case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
     case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
     case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
+    case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:
+        return m_context->getFramebufferAttachmentParameteri(target, attachment, pname);
     case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
+        if (attachment == GraphicsContextGL::DEPTH_STENCIL_ATTACHMENT) {
+            synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, functionName, "COMPONENT_TYPE can't be queried for DEPTH_STENCIL_ATTACHMENT");
+            return nullptr;
+        }
         return m_context->getFramebufferAttachmentParameteri(target, attachment, pname);
     }
 
-    if (object->isTexture()) {
-        switch (pname) {
-        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
-            return static_cast<unsigned>(GraphicsContextGL::TEXTURE);
-        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
-            return makeRefPtr(reinterpret_cast<WebGLTexture&>(*object));
-        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
-        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
-        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:
-            return m_context->getFramebufferAttachmentParameteri(target, attachment, pname);
-        default:
-            synthesizeGLError(GraphicsContextGL::INVALID_ENUM, functionName, "invalid parameter name for texture attachment");
-            return nullptr;
-        }
-    } else {
-        ASSERT(object->isRenderbuffer());
-        switch (pname) {
-        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
-            return static_cast<unsigned>(GraphicsContextGL::RENDERBUFFER);
-        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
-            return makeRefPtr(reinterpret_cast<WebGLRenderbuffer&>(*object));
-        case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING : {
-            auto& renderBuffer = reinterpret_cast<WebGLRenderbuffer&>(*object);
-            auto format = renderBuffer.getInternalFormat();
-            if (format == GraphicsContextGL::SRGB8_ALPHA8
-                || format == GraphicsContextGL::COMPRESSED_SRGB8_ETC2
-                || format == GraphicsContextGL::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
-                || format == GraphicsContextGL::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2) {
-                return static_cast<unsigned>(GraphicsContextGL::SRGB);
-            }
-            return static_cast<unsigned>(GraphicsContextGL::LINEAR);
-        }
-        default:
-            synthesizeGLError(GraphicsContextGL::INVALID_ENUM, functionName, "invalid parameter name for renderbuffer attachment");
-            return nullptr;
-        }
-    }
+    synthesizeGLError(GraphicsContextGL::INVALID_ENUM, functionName, "invalid parameter name for attachment");
+    return nullptr;
 }
 
 bool WebGL2RenderingContext::validateFramebufferTarget(GCGLenum target)

Modified: trunk/Source/WebCore/html/canvas/WebGLObject.cpp (271443 => 271444)


--- trunk/Source/WebCore/html/canvas/WebGLObject.cpp	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/Source/WebCore/html/canvas/WebGLObject.cpp	2021-01-13 18:56:35 UTC (rev 271444)
@@ -67,15 +67,7 @@
     if (!hasGroupOrContext())
         return;
 
-    // ANGLE correctly handles object deletion with WebGL semantics.
-    // For other GL implementations, delay deletion until we know
-    // the object is not attached anywhere.
-#if USE(ANGLE)
-    if (!m_calledDelete) {
-        m_calledDelete = true;
-#else
     if (!m_attachmentCount) {
-#endif
         if (!context3d)
             context3d = getAGraphicsContextGL();
 

Modified: trunk/Source/WebCore/html/canvas/WebGLObject.h (271443 => 271444)


--- trunk/Source/WebCore/html/canvas/WebGLObject.h	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/Source/WebCore/html/canvas/WebGLObject.h	2021-01-13 18:56:35 UTC (rev 271444)
@@ -94,9 +94,6 @@
     PlatformGLObject m_object { 0 };
     unsigned m_attachmentCount { 0 };
     bool m_deleted { false };
-#if USE(ANGLE)
-    bool m_calledDelete { false };
-#endif
 };
 
 inline PlatformGLObject objectOrZero(WebGLObject* object)

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (271443 => 271444)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2021-01-13 18:56:35 UTC (rev 271444)
@@ -1342,7 +1342,7 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("attachShader", &program) || !validateWebGLProgramOrShader("attachShader", &shader))
+    if (!validateWebGLProgramOrShader("attachShader", &program) || !validateWebGLProgramOrShader("attachShader", &shader))
         return;
     if (!program.attachShader(locker, &shader)) {
         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "attachShader", "shader attachment already has shader");
@@ -1354,7 +1354,7 @@
 
 void WebGLRenderingContextBase::bindAttribLocation(WebGLProgram& program, GCGLuint index, const String& name)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("bindAttribLocation", &program))
+    if (!validateWebGLProgramOrShader("bindAttribLocation", &program))
         return;
     if (!validateLocationLength("bindAttribLocation", name))
         return;
@@ -1371,21 +1371,16 @@
     m_context->bindAttribLocation(program.object(), index, name);
 }
 
-bool WebGLRenderingContextBase::checkObjectToBeBound(const char* functionName, WebGLObject* object)
+bool WebGLRenderingContextBase::validateNullableWebGLObject(const char* functionName, WebGLObject* object)
 {
     if (isContextLostOrPending())
         return false;
-    if (object) {
-        if (!object->validate(contextGroup(), *this)) {
-            synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, functionName, "object not from this context");
-            return false;
-        }
-        if (!object->object()) {
-            synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, functionName, "deleted objects cannot be bound");
-            return false;
-        }
+    if (!object) {
+        // This differs in behavior to ValidateWebGLObject; null objects are allowed
+        // in these entry points.
+        return true;
     }
-    return true;
+    return validateWebGLObject(functionName, object);
 }
 
 bool WebGLRenderingContextBase::validateBufferTarget(const char* functionName, GCGLenum target)
@@ -1447,7 +1442,7 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (!checkObjectToBeBound("bindBuffer", buffer))
+    if (!validateNullableWebGLObject("bindBuffer", buffer))
         return;
 
     if (!validateAndCacheBufferBinding(locker, "bindBuffer", target, buffer))
@@ -1460,7 +1455,7 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (!checkObjectToBeBound("bindFramebuffer", buffer))
+    if (!validateNullableWebGLObject("bindFramebuffer", buffer))
         return;
 
     if (target != GraphicsContextGL::FRAMEBUFFER) {
@@ -1475,7 +1470,7 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (!checkObjectToBeBound("bindRenderbuffer", renderBuffer))
+    if (!validateNullableWebGLObject("bindRenderbuffer", renderBuffer))
         return;
     if (target != GraphicsContextGL::RENDERBUFFER) {
         synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "bindRenderbuffer", "invalid target");
@@ -1491,7 +1486,7 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (!checkObjectToBeBound("bindTexture", texture))
+    if (!validateNullableWebGLObject("bindTexture", texture))
         return;
     if (texture && texture->getTarget() && texture->getTarget() != target) {
         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "bindTexture", "textures can not be used with multiple targets");
@@ -1751,7 +1746,7 @@
 
 void WebGLRenderingContextBase::compileShader(WebGLShader& shader)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("compileShader", &shader))
+    if (!validateWebGLProgramOrShader("compileShader", &shader))
         return;
     m_context->compileShader(shader.object());
     GCGLint value = m_context->getShaderi(shader.object(), GraphicsContextGL::COMPILE_STATUS);
@@ -2166,7 +2161,7 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("detachShader", &program) || !validateWebGLProgramOrShader("detachShader", &shader))
+    if (!validateWebGLProgramOrShader("detachShader", &program) || !validateWebGLProgramOrShader("detachShader", &shader))
         return;
     if (!program.detachShader(locker, &shader)) {
         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "detachShader", "shader not attached");
@@ -2381,11 +2376,13 @@
 
 bool WebGLRenderingContextBase::validateWebGLObject(const char* functionName, WebGLObject* object)
 {
+    if (isContextLostOrPending())
+        return false;
     if (!object) {
         synthesizeGLError(GraphicsContextGL::INVALID_VALUE, functionName, "object is null");
         return false;
     }
-    if (!object->object()) {
+    if (object->isDeleted()) {
         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, functionName, "attempt to use a deleted object");
         return false;
     }
@@ -2398,12 +2395,21 @@
 
 bool WebGLRenderingContextBase::validateWebGLProgramOrShader(const char* functionName, WebGLObject* object)
 {
+    if (isContextLostOrPending())
+        return false;
     if (!object) {
         synthesizeGLError(GraphicsContextGL::INVALID_VALUE, functionName, "program or shader is null");
         return false;
     }
-    // Using a deleted program or shader is INVALID_VALUE instead of INVALID_OPERATION as for
-    // other WebGL objects.
+    // OpenGL ES 3.0.5 p. 45:
+    // "Commands that accept shader or program object names will generate the
+    // error INVALID_VALUE if the provided name is not the name of either a shader
+    // or program object and INVALID_OPERATION if the provided name identifies an
+    // object that is not the expected type."
+    //
+    // Programs and shaders also have slightly different lifetime rules than other
+    // objects in the API; they continue to be usable after being marked for
+    // deletion.
     if (!object->object()) {
         synthesizeGLError(GraphicsContextGL::INVALID_VALUE, functionName, "attempt to use a deleted program or shader");
         return false;
@@ -2712,10 +2718,8 @@
         synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "framebufferRenderbuffer", "invalid target");
         return;
     }
-    if (buffer && !buffer->validate(contextGroup(), *this)) {
-        synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "framebufferRenderbuffer", "no buffer or buffer not from this context");
+    if (!validateNullableWebGLObject("framebufferRenderbuffer", buffer))
         return;
-    }
     if (buffer && !buffer->hasEverBeenBound()) {
         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "framebufferRenderbuffer", "buffer has never been bound");
         return;
@@ -2741,16 +2745,13 @@
         synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "framebufferTexture2D", "level not 0 and OES_fbo_render_mipmap not enabled");
         return;
     }
-    if (texture && !texture->validate(contextGroup(), *this)) {
-        synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "framebufferTexture2D", "no texture or texture not from this context");
+    if (!validateNullableWebGLObject("framebufferTexture2D", texture))
         return;
-    }
 
-    WebGLFramebuffer* framebufferBinding = getFramebufferBinding(target);
-
     // Don't allow the default framebuffer to be mutated; all current
     // implementations use an FBO internally in place of the default
     // FBO.
+    WebGLFramebuffer* framebufferBinding = getFramebufferBinding(target);
     if (!framebufferBinding || !framebufferBinding->object()) {
         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "framebufferTexture2D", "no framebuffer bound");
         return;
@@ -2810,7 +2811,7 @@
 
 RefPtr<WebGLActiveInfo> WebGLRenderingContextBase::getActiveAttrib(WebGLProgram& program, GCGLuint index)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getActiveAttrib", &program))
+    if (!validateWebGLProgramOrShader("getActiveAttrib", &program))
         return nullptr;
     GraphicsContextGL::ActiveInfo info;
     if (!m_context->getActiveAttrib(program.object(), index, info))
@@ -2823,7 +2824,7 @@
 
 RefPtr<WebGLActiveInfo> WebGLRenderingContextBase::getActiveUniform(WebGLProgram& program, GCGLuint index)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getActiveUniform", &program))
+    if (!validateWebGLProgramOrShader("getActiveUniform", &program))
         return nullptr;
     GraphicsContextGL::ActiveInfo info;
     if (!m_context->getActiveUniform(program.object(), index, info))
@@ -2840,7 +2841,7 @@
 
 Optional<Vector<RefPtr<WebGLShader>>> WebGLRenderingContextBase::getAttachedShaders(WebGLProgram& program)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getAttachedShaders", &program))
+    if (!validateWebGLProgramOrShader("getAttachedShaders", &program))
         return WTF::nullopt;
 
     const GCGLenum shaderTypes[] = {
@@ -2858,7 +2859,7 @@
 
 GCGLint WebGLRenderingContextBase::getAttribLocation(WebGLProgram& program, const String& name)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getAttribLocation", &program))
+    if (!validateWebGLProgramOrShader("getAttribLocation", &program))
         return -1;
     if (!validateLocationLength("getAttribLocation", name))
         return -1;
@@ -3256,7 +3257,7 @@
 
 String WebGLRenderingContextBase::getProgramInfoLog(WebGLProgram& program)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getProgramInfoLog", &program))
+    if (!validateWebGLProgramOrShader("getProgramInfoLog", &program))
         return String();
     return ensureNotNull(m_context->getProgramInfoLog(program.object()));
 }
@@ -3362,7 +3363,7 @@
 
 String WebGLRenderingContextBase::getShaderInfoLog(WebGLShader& shader)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getShaderInfoLog", &shader))
+    if (!validateWebGLProgramOrShader("getShaderInfoLog", &shader))
         return String();
     return ensureNotNull(m_context->getShaderInfoLog(shader.object()));
 }
@@ -3400,7 +3401,7 @@
 
 String WebGLRenderingContextBase::getShaderSource(WebGLShader& shader)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getShaderSource", &shader))
+    if (!validateWebGLProgramOrShader("getShaderSource", &shader))
         return String();
     return ensureNotNull(shader.getSource());
 }
@@ -3431,7 +3432,7 @@
 
 WebGLAny WebGLRenderingContextBase::getUniform(WebGLProgram& program, const WebGLUniformLocation& uniformLocation)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getUniform", &program))
+    if (!validateWebGLProgramOrShader("getUniform", &program))
         return nullptr;
     if (uniformLocation.program() != &program) {
         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "getUniform", "no uniformlocation or not valid for this program");
@@ -3635,7 +3636,7 @@
 
 RefPtr<WebGLUniformLocation> WebGLRenderingContextBase::getUniformLocation(WebGLProgram& program, const String& name)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("getUniformLocation", &program))
+    if (!validateWebGLProgramOrShader("getUniformLocation", &program))
         return nullptr;
     if (!validateLocationLength("getUniformLocation", name))
         return nullptr;
@@ -3690,6 +3691,9 @@
     if ((isWebGL2() || m_angleInstancedArrays) && pname == GraphicsContextGL::VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)
         return state.divisor;
 
+    if (isWebGL2() && pname == GraphicsContextGL::VERTEX_ATTRIB_ARRAY_INTEGER)
+        return state.isInteger;
+
     switch (pname) {
     case GraphicsContextGL::VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
 #if !USE(ANGLE)
@@ -3809,11 +3813,13 @@
 
 GCGLboolean WebGLRenderingContextBase::isBuffer(WebGLBuffer* buffer)
 {
-    if (!buffer || isContextLostOrPending())
+    if (!buffer || isContextLostOrPending() || !buffer->validate(contextGroup(), *this))
         return 0;
 
     if (!buffer->hasEverBeenBound())
         return 0;
+    if (buffer->isDeleted())
+        return 0;
 
     return m_context->isBuffer(buffer->object());
 }
@@ -3855,11 +3861,13 @@
 
 GCGLboolean WebGLRenderingContextBase::isFramebuffer(WebGLFramebuffer* framebuffer)
 {
-    if (!framebuffer || isContextLostOrPending())
+    if (!framebuffer || isContextLostOrPending() || !framebuffer->validate(contextGroup(), *this))
         return 0;
 
     if (!framebuffer->hasEverBeenBound())
         return 0;
+    if (framebuffer->isDeleted())
+        return 0;
 
     return m_context->isFramebuffer(framebuffer->object());
 }
@@ -3866,19 +3874,25 @@
 
 GCGLboolean WebGLRenderingContextBase::isProgram(WebGLProgram* program)
 {
-    if (!program || isContextLostOrPending())
+    if (!program || isContextLostOrPending() || !program->validate(contextGroup(), *this))
         return 0;
 
+    // OpenGL ES special-cases the behavior of program objects; if they're deleted
+    // while attached to the current context state, glIsProgram is supposed to
+    // still return true. For this reason, isDeleted is not checked here.
+
     return m_context->isProgram(program->object());
 }
 
 GCGLboolean WebGLRenderingContextBase::isRenderbuffer(WebGLRenderbuffer* renderbuffer)
 {
-    if (!renderbuffer || isContextLostOrPending())
+    if (!renderbuffer || isContextLostOrPending() || !renderbuffer->validate(contextGroup(), *this))
         return 0;
 
     if (!renderbuffer->hasEverBeenBound())
         return 0;
+    if (renderbuffer->isDeleted())
+        return 0;
 
     return m_context->isRenderbuffer(renderbuffer->object());
 }
@@ -3885,19 +3899,25 @@
 
 GCGLboolean WebGLRenderingContextBase::isShader(WebGLShader* shader)
 {
-    if (!shader || isContextLostOrPending())
+    if (!shader || isContextLostOrPending() || !shader->validate(contextGroup(), *this))
         return 0;
 
+    // OpenGL ES special-cases the behavior of shader objects; if they're deleted
+    // while attached to a program, glIsShader is supposed to still return true.
+    // For this reason, isDeleted is not checked here.
+
     return m_context->isShader(shader->object());
 }
 
 GCGLboolean WebGLRenderingContextBase::isTexture(WebGLTexture* texture)
 {
-    if (!texture || isContextLostOrPending())
+    if (!texture || isContextLostOrPending() || !texture->validate(contextGroup(), *this))
         return 0;
 
     if (!texture->hasEverBeenBound())
         return 0;
+    if (texture->isDeleted())
+        return 0;
 
     return m_context->isTexture(texture->object());
 }
@@ -3919,7 +3939,7 @@
 
 bool WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations(WebGLProgram* program)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("linkProgram", program))
+    if (!validateWebGLProgramOrShader("linkProgram", program))
         return false;
 
     RefPtr<WebGLShader> vertexShader = program->getAttachedShader(GraphicsContextGL::VERTEX_SHADER);
@@ -4471,7 +4491,7 @@
 
 void WebGLRenderingContextBase::shaderSource(WebGLShader& shader, const String& string)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("shaderSource", &shader))
+    if (!validateWebGLProgramOrShader("shaderSource", &shader))
         return;
 #if USE(ANGLE)
     m_context->shaderSource(shader.object(), string);
@@ -5996,7 +6016,7 @@
 {
     auto locker = holdLock(objectGraphLock());
 
-    if (!checkObjectToBeBound("useProgram", program))
+    if (!validateNullableWebGLObject("useProgram", program))
         return;
     if (program && !program->getLinkStatus()) {
         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "useProgram", "program not valid");
@@ -6014,7 +6034,7 @@
 
 void WebGLRenderingContextBase::validateProgram(WebGLProgram& program)
 {
-    if (isContextLostOrPending() || !validateWebGLProgramOrShader("validateProgram", &program))
+    if (!validateWebGLProgramOrShader("validateProgram", &program))
         return;
     m_context->validateProgram(program.object());
 }
@@ -6126,7 +6146,7 @@
     }
     GCGLsizei bytesPerElement = size * typeSize;
 
-    m_boundVertexArrayObject->setVertexAttribState(locker, index, bytesPerElement, size, type, normalized, stride, static_cast<GCGLintptr>(offset), m_boundArrayBuffer.get());
+    m_boundVertexArrayObject->setVertexAttribState(locker, index, bytesPerElement, size, type, normalized, stride, static_cast<GCGLintptr>(offset), false, m_boundArrayBuffer.get());
     m_context->vertexAttribPointer(index, size, type, normalized, stride, static_cast<GCGLintptr>(offset));
 }
 
@@ -7718,14 +7738,7 @@
 #if USE(ANGLE)
     if (isContextLostOrPending())
         return;
-#endif // USE(ANGLE)
-
-    if (!primcount) {
-        markContextChanged();
-        return;
-    }
-
-#if !USE(ANGLE)
+#else
     if (!validateDrawArrays("drawArraysInstanced", mode, first, count, primcount))
         return;
 #endif // !USE(ANGLE)
@@ -7763,14 +7776,7 @@
 #if USE(ANGLE)
     if (isContextLostOrPending())
         return;
-#endif
-
-    if (!primcount) {
-        markContextChanged();
-        return;
-    }
-
-#if !USE(ANGLE)
+#else
     unsigned numElements = 0;
     if (!validateDrawElements("drawElementsInstanced", mode, count, type, offset, numElements, primcount))
         return;

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (271443 => 271444)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h	2021-01-13 18:56:35 UTC (rev 271444)
@@ -495,7 +495,14 @@
     bool validateIndexArrayPrecise(GCGLsizei count, GCGLenum type, GCGLintptr offset, unsigned& numElementsRequired);
     bool validateVertexAttributes(unsigned elementCount, unsigned primitiveCount = 0);
 
+    // Validates the incoming WebGL object, which is assumed to be non-null.
+    // Checks that the object belongs to this context and that it's not marked for
+    // deletion. Performs a context lost check internally.
     bool validateWebGLObject(const char*, WebGLObject*);
+
+    // Validates the incoming WebGL program or shader, which is assumed to be
+    // non-null. OpenGL ES's validation rules differ for these types of objects
+    // compared to others. Performs a context lost check internally.
     bool validateWebGLProgramOrShader(const char*, WebGLObject*);
 
 #if !USE(ANGLE)
@@ -1046,9 +1053,13 @@
     // Return false if caller should return without further processing.
     bool deleteObject(const WTF::AbstractLocker&, WebGLObject*);
 
-    // Helper function for bind* (bindBuffer, bindTexture, etc) and useProgram.
-    // Return false if caller should return without further processing.
-    bool checkObjectToBeBound(const char* functionName, WebGLObject*);
+    // Helper function for APIs which can legally receive null objects, including
+    // the bind* calls (bindBuffer, bindTexture, etc.) and useProgram. Checks that
+    // the object belongs to this context and that it's not marked for deletion.
+    // Returns false if the caller should return without further processing.
+    // Performs a context lost check internally.
+    // This returns true for null WebGLObject arguments!
+    bool validateNullableWebGLObject(const char* functionName, WebGLObject*);
 
     // Helper function to validate the target for bufferData and
     // getBufferParameter.

Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp (271443 => 271444)


--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp	2021-01-13 18:56:35 UTC (rev 271444)
@@ -52,7 +52,7 @@
     
 }
 
-void WebGLVertexArrayObjectBase::setVertexAttribState(const AbstractLocker& locker, GCGLuint index, GCGLsizei bytesPerElement, GCGLint size, GCGLenum type, GCGLboolean normalized, GCGLsizei stride, GCGLintptr offset, WebGLBuffer* buffer)
+void WebGLVertexArrayObjectBase::setVertexAttribState(const AbstractLocker& locker, GCGLuint index, GCGLsizei bytesPerElement, GCGLint size, GCGLenum type, GCGLboolean normalized, GCGLsizei stride, GCGLintptr offset, bool isInteger, WebGLBuffer* buffer)
 {
     GCGLsizei validatedStride = stride ? stride : bytesPerElement;
     
@@ -71,6 +71,7 @@
     state.stride = validatedStride;
     state.originalStride = stride;
     state.offset = offset;
+    state.isInteger = isInteger;
 }
 
 void WebGLVertexArrayObjectBase::unbindBuffer(const AbstractLocker& locker, WebGLBuffer& buffer)

Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h (271443 => 271444)


--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h	2021-01-13 18:56:35 UTC (rev 271444)
@@ -60,6 +60,7 @@
         GCGLsizei originalStride { 0 };
         GCGLintptr offset { 0 };
         GCGLuint divisor { 0 };
+        bool isInteger { false };
     };
 
     bool isDefaultObject() const { return m_type == Type::Default; }
@@ -71,7 +72,7 @@
     void setElementArrayBuffer(const WTF::AbstractLocker&, WebGLBuffer*);
 
     VertexAttribState& getVertexAttribState(int index) { return m_vertexAttribState[index]; }
-    void setVertexAttribState(const WTF::AbstractLocker&, GCGLuint, GCGLsizei, GCGLint, GCGLenum, GCGLboolean, GCGLsizei, GCGLintptr, WebGLBuffer*);
+    void setVertexAttribState(const WTF::AbstractLocker&, GCGLuint, GCGLsizei, GCGLint, GCGLenum, GCGLboolean, GCGLsizei, GCGLintptr, bool, WebGLBuffer*);
     void unbindBuffer(const WTF::AbstractLocker&, WebGLBuffer&);
 
     void setVertexAttribDivisor(GCGLuint index, GCGLuint divisor);

Modified: trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp (271443 => 271444)


--- trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp	2021-01-13 18:51:01 UTC (rev 271443)
+++ trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp	2021-01-13 18:56:35 UTC (rev 271444)
@@ -292,23 +292,6 @@
     if (!makeContextCurrent())
         return;
     gl::GetIntegervRobustANGLE(pname, value.bufSize, nullptr, value.data);
-
-    switch (pname) {
-#if PLATFORM(MAC)
-    // Some older hardware advertises a larger maximum than they
-    // can actually handle. Rather than detecting such devices, simply
-    // clamp the maximum to 8192, which is big enough for a 5K display.
-    case MAX_RENDERBUFFER_SIZE:
-        *value = std::min(8192, *value);
-        break;
-    case MAX_VIEWPORT_DIMS:
-        value[0] = std::min(8192, value[0]);
-        value[1] = std::min(8192, value[1]);
-        break;
-#endif
-    default:
-        break;
-    }
 }
 
 void GraphicsContextGLOpenGL::getShaderPrecisionFormat(GCGLenum shaderType, GCGLenum precisionType, GCGLSpan<GCGLint, 2> range, GCGLint* precision)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to