Bug 223360 - webgl/2.0.y/conformance2/vertex_arrays/vertex-array-object.html fails
Summary: webgl/2.0.y/conformance2/vertex_arrays/vertex-array-object.html fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: InRadar
Depends on:
Blocks: webgl2conformance
  Show dependency treegraph
 
Reported: 2021-03-17 00:49 PDT by Kimmo Kinnunen
Modified: 2021-09-08 22:28 PDT (History)
10 users (show)

See Also:


Attachments
Patch (22.79 KB, patch)
2021-09-08 06:47 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff
Patch (23.27 KB, patch)
2021-09-08 07:52 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff
Patch (23.45 KB, patch)
2021-09-08 13:08 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2021-03-17 00:49:36 PDT
webgl/2.0.1/conformance2/vertex_arrays/vertex-array-object.html fails

https://www.khronos.org/registry/webgl/sdk/tests/conformance2/vertex_arrays/vertex-array-object.html?webglVersion=2&quiet=0&quick=1

This test verifies the functionality of the Vertex Array Objects.

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


PASS WebGL context exists
Testing binding enum
PASS gl.VERTEX_ARRAY_BINDING is 0x85B5
PASS getError was expected value: NO_ERROR : VERTEX_ARRAY_BINDING query should succeed
PASS Default value of VERTEX_ARRAY_BINDING is null
Testing binding a VAO
PASS gl.getParameter(gl.VERTEX_ARRAY_BINDING) is null
PASS gl.getParameter(gl.VERTEX_ARRAY_BINDING) is expected VAO
PASS gl.getParameter(gl.VERTEX_ARRAY_BINDING) is expected VAO
PASS gl.getParameter(gl.VERTEX_ARRAY_BINDING) is null
PASS getError was expected value: INVALID_OPERATION : binding a deleted vertex array object
PASS gl.getParameter(gl.VERTEX_ARRAY_BINDING) is null
Testing object creation
PASS getError was expected value: NO_ERROR : createVertexArray should not set an error
PASS vao is non-null.
PASS gl.isVertexArray(vao) is false
PASS gl.isVertexArray(vao) is true
PASS gl.isVertexArray(vao) is true
PASS gl.isVertexArray(null) is false
Testing attributes work across bindings
PASS All attributes preserved across bindings
Testing that attribute values are not attached to bindings
PASS Vertex attribute values are not attached to bindings
Testing draws with various VAO bindings
PASS Draw 0 passed pixel test
PASS Draw 1 passed pixel test
PASS Draw 2 passed pixel test
PASS should be green
PASS should be green
Testing using buffers that are deleted when attached to unbound VAOs
PASS should be 255,0,0,255
PASS should be 0,255,0,255
PASS should be 0,0,255,255
PASS should be 0,255,255,255
Testing using buffers that are deleted when attached to bound VAOs
FAIL getError expected: INVALID_OPERATION. Was NO_ERROR : Draw call should fail.
PASS getError was expected value: NO_ERROR : Draw call should not fail.
PASS getError was expected value: NO_ERROR : Draw call should not fail.
PASS getError was expected value: NO_ERROR : Draw call should not fail.
Testing that VAOs don't effect ARRAY_BUFFER binding.
PASS should be red
PASS should be green
PASS getError was expected value: NO_ERROR : there should be no errors

PASS successfullyParsed is true

TEST COMPLETE
Comment 1 Kimmo Kinnunen 2021-03-17 01:45:44 PDT
At least macOS 11.3, iMacPro1,1, Radeon Pro Vega 56
Comment 2 Radar WebKit Bug Importer 2021-03-24 00:50:13 PDT
<rdar://problem/75774546>
Comment 3 Kimmo Kinnunen 2021-09-08 06:47:23 PDT
Created attachment 437623 [details]
Patch
Comment 4 Kimmo Kinnunen 2021-09-08 07:52:16 PDT
Created attachment 437627 [details]
Patch
Comment 5 Dean Jackson 2021-09-08 10:58:58 PDT
Comment on attachment 437627 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437627&action=review

> Source/WebCore/ChangeLog:14
> +        WebGL specific constraint is not checked by ANGLE. Add this check to
> +        WebCore.

Shouldn't this be in ANGLE when validating against WebGL?
Comment 6 Kimmo Kinnunen 2021-09-08 12:09:40 PDT
(In reply to Dean Jackson from comment #5)
> Comment on attachment 437627 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=437627&action=review
> 
> > Source/WebCore/ChangeLog:14
> > +        WebGL specific constraint is not checked by ANGLE. Add this check to
> > +        WebCore.
> 
> Shouldn't this be in ANGLE when validating against WebGL?

This should be said about 90% of the `validate*` functions.
But you're right, there's something special about this logic that I failed to express when writing the ChangeLog. I'll revise it:

The problem is that when doing the ANGLE side VAO update on buffer delete, WebCore relies on deleting the ANGLE side buffer. This works when the deleted buffer is in only one VAO.

However, when buffer is shared by multiple bindings, the ANGLE side buffer is not deleted until last binding is freed. Thus from ANGLE's perspective the buffer is in the VAO and the validation passes.
Comment 7 Kenneth Russell 2021-09-08 12:16:06 PDT
Comment on attachment 437627 [details]
Patch

Great; yes, this validation was most easily implemented in the browser's code rather than down in ANGLE due to the object lifetimes and the needed caching. (All objects bound into the WebGL context have to have mirrors at the C++ level; this includes vertex array objects.)
Comment 8 Kimmo Kinnunen 2021-09-08 13:08:41 PDT
Created attachment 437659 [details]
Patch
Comment 9 EWS 2021-09-08 22:28:01 PDT
Committed r282192 (241479@main): <https://commits.webkit.org/241479@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437659 [details].