Bug 96828 - webgl/1.0.4/conformance/extensions/oes-vertex-array-object.html fails
Summary: webgl/1.0.4/conformance/extensions/oes-vertex-array-object.html fails
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 223372 (view as bug list)
Depends on: 96578
Blocks: webgl2conformance
  Show dependency treegraph
 
Reported: 2012-09-14 15:08 PDT by Brandon Jones
Modified: 2021-08-03 01:06 PDT (History)
9 users (show)

See Also:


Attachments
Patch (6.64 KB, patch)
2021-07-15 01:01 PDT, Eleni Maria Stea
no flags Details | Formatted Diff | Diff
Patch (7.30 KB, patch)
2021-07-15 03:10 PDT, Eleni Maria Stea
estea: review?
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brandon Jones 2012-09-14 15:08:37 PDT
fast/canvas/webgl/oes-vertex-array-object.html has been added to the skipped test files for most platforms. (https://bugs.webkit.org/show_bug.cgi?id=96578) 

As various platforms are confirmed to support the OES_vertex_array_object extension they should re-enable this test.
Comment 1 Alexey Proskuryakov 2015-01-22 15:09:16 PST
rdar://problem/17258149
Comment 2 Kimmo Kinnunen 2021-03-17 02:04:44 PDT
*** Bug 223372 has been marked as a duplicate of this bug. ***
Comment 3 Kimmo Kinnunen 2021-03-17 02:19:43 PDT
webgl/1.0.4/conformance/extensions/oes-vertex-array-object.html  fails on iOS-simulator

--- /Users/kkinnunen/Build/Release-iphonesimulator/layout-test-results/webgl/1.0.4/conformance/extensions/oes-vertex-array-object-expected.txt
+++ /Users/kkinnunen/Build/Release-iphonesimulator/layout-test-results/webgl/1.0.4/conformance/extensions/oes-vertex-array-object-actual.txt
@@ -1,4 +1,76 @@
 This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
 
 Test: ../../../resources/webgl_test_files/conformance/extensions/oes-vertex-array-object.html
-[ PASS ] All tests passed
+
+[ 1: PASS ] WebGL context exists
+[ 2: PASS ] getError was expected value: INVALID_ENUM : VERTEX_ARRAY_BINDING_OES should not be queryable if extension is disabled
+[ 3: PASS ] Successfully enabled OES_vertex_array_object extension
+[ 4: PASS ] OES_vertex_array_object listed as supported and getExtension succeeded
+[ 5: PASS ] ext.VERTEX_ARRAY_BINDING_OES is 0x85B5
+[ 6: PASS ] getError was expected value: NO_ERROR : VERTEX_ARRAY_BINDING_OES query should succeed if extension is enabled
+[ 7: PASS ] Default value of VERTEX_ARRAY_BINDING_OES is null
+[ 8: PASS ] gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) is null
+[ 9: PASS ] gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) is expected VAO
+[ 10: PASS ] gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) is expected VAO
+[ 11: PASS ] gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) is null
+[ 12: PASS ] getError was expected value: INVALID_OPERATION : binding a deleted vertex array object
+[ 13: PASS ] gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) is null
+[ 14: PASS ] getError was expected value: NO_ERROR : createVertexArrayOES should not set an error
+[ 15: PASS ] vao is non-null.
+[ 16: PASS ] ext.isVertexArrayOES(vao) is false
+[ 17: PASS ] ext.isVertexArrayOES(vao) is true
+[ 18: PASS ] ext.isVertexArrayOES(vao) is true
+[ 19: PASS ] ext.isVertexArrayOES(null) is false
+[ 20: PASS ] All attributes preserved across bindings
+[ 21: PASS ] Vertex attribute values are not attached to bindings
+[ 22: PASS ] Drawing with the default VAO should pass
+[ 23: PASS ] Drawing with the default VAO should pass
+[ 24: PASS ] Drawing with the default VAO should pass
+[ 25: PASS ] Drawing with the default VAO should pass
+[ 26: PASS ] Drawing with the default VAO should pass
+[ 27: PASS ] Drawing with the default VAO should pass
+[ 28: PASS ] Drawing with VAO #0 should pass
+[ 29: PASS ] Drawing with VAO #0 should pass
+[ 30: PASS ] Drawing with VAO #0 should pass
+[ 31: PASS ] Drawing with VAO #0 should pass
+[ 32: PASS ] Drawing with VAO #0 should pass
+[ 33: PASS ] Drawing with VAO #0 should pass
+[ 34: PASS ] Drawing with VAO #1 should pass
+[ 35: PASS ] Drawing with VAO #1 should pass
+[ 36: PASS ] Drawing with VAO #1 should pass
+[ 37: PASS ] Drawing with VAO #1 should pass
+[ 38: PASS ] Drawing with VAO #1 should pass
+[ 39: PASS ] Drawing with VAO #1 should pass
+[ 40: PASS ] Drawing with VAO that has the color array disabled should pass
+[ 41: PASS ] Drawing with VAO that has the color array disabled should pass
+[ 42: PASS ] Drawing with VAO that has the color array disabled should pass
+[ 43: PASS ] Drawing with VAO that has the color array disabled should pass
+[ 44: PASS ] Drawing with VAO that has the color array disabled should pass
+[ 45: PASS ] Drawing with VAO that has the color array disabled should pass
+[ 46: PASS ] Drawing after deleting another VAO should pass
+[ 47: PASS ] Drawing after deleting another VAO should pass
+[ 48: PASS ] Drawing after deleting another VAO should pass
+[ 49: PASS ] Drawing after deleting another VAO should pass
+[ 50: PASS ] Drawing after deleting another VAO should pass
+[ 51: PASS ] Drawing after deleting another VAO should pass
+[ 52: PASS ] Drawing after deleting the VAO that was bound should pass
+[ 53: PASS ] Drawing after deleting the VAO that was bound should pass
+[ 54: PASS ] Drawing after deleting the VAO that was bound should pass
+[ 55: PASS ] Drawing after deleting the VAO that was bound should pass
+[ 56: PASS ] Drawing after deleting the VAO that was bound should pass
+[ 57: PASS ] Drawing after deleting the VAO that was bound should pass
+[ 58: PASS ] should be green
+[ 59: PASS ] should be green
+[ 60: PASS ] should be 255,0,0,255
+[ 61: PASS ] should be 0,255,0,255
+[ 62: PASS ] should be 0,0,255,255
+[ 63: PASS ] should be 0,255,255,255
+[ 64: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : Draw call should fail.
+[ 65: PASS ] getError was expected value: NO_ERROR : Draw call should not fail.
+[ 66: PASS ] getError was expected value: NO_ERROR : Draw call should not fail.
+[ 67: PASS ] getError was expected value: NO_ERROR : Draw call should not fail.
+[ 68: PASS ] should be red
+[ 69: PASS ] should be green
+[ 70: PASS ] getError was expected value: NO_ERROR : there should be no errors
+[ 71: PASS ] successfullyParsed is true
+[ FAIL ] 1 failures reported
Comment 5 Eleni Maria Stea 2021-07-15 01:01:30 PDT
Created attachment 433567 [details]
Patch
Comment 6 Eleni Maria Stea 2021-07-15 01:06:01 PDT
I've taken a look at this bug, drawing with the 0 (null in webgl) VAO was not possible because internally we didn't bind the default object but we were calling glBindVertexArray(0), where 0 is the invalid object. Besides we didn't create/delete the default object.

OpenGL versions >= 3.0 require VAOs for rendering, and so we should always bind the secret default VAO when no other VAO is bound in the WebGL implementation.

The patch above seems to fix the drawing errors (DrawTests) in GTK, but I haven't tested it in other platforms.
Comment 7 Eleni Maria Stea 2021-07-15 01:40:18 PDT
Including GLContext.h breaks the other builds, I'll try to fix this.
Comment 8 Eleni Maria Stea 2021-07-15 03:10:14 PDT
Created attachment 433573 [details]
Patch
Comment 9 Kimmo Kinnunen 2021-08-03 01:06:24 PDT
Comment on attachment 433573 [details]
Patch

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

Thanks for the patch. I'm not sure this approach works for the default case where ANGLE is being used.

Note: supporting WebGL *correctly* on top of OpenGL is very demanding. This is what ANGLE is currently implementing, e.g. most probably in the end the implementation would amount to almost re-implementing ANGLE.
This would indicate that it would maybe be more fruitful to work on getting WPE,GLIB, et al be able to run WebGL with ANGLE. There should not be any architectural problems, but of course it's a bit of a grind.

> Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp:33
> +#include "GLContext.h"

The GLContext.h is an implementation detail of the ports that implement compositor with "texture mapper", e.g. GLIB/WPE/.. , non-apple ports. 

In the WebCore WebGL implementation level, this cannot be used.
We should use GraphicsContextGL abstraction in this level.

I'm not very knowledgeable in the way current non-ANGLE implementation is simulating this VAO feature. However, it probably should follow the structure similar to  what is being done in functions such as WebGLRenderingContextBase::validateVertexAttributes.