Bug 243160 - [GraphicsContextGLTextureMapperANGLE][WebGL2] webgl/2.0.0/conformance2/query/occlusion-query.html is failing
Summary: [GraphicsContextGLTextureMapperANGLE][WebGL2] webgl/2.0.0/conformance2/query/...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-07-24 18:10 PDT by Fujii Hironori
Modified: 2022-07-25 16:19 PDT (History)
9 users (show)

See Also:


Attachments
Patch (3.02 KB, patch)
2022-07-24 18:14 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2022-07-24 18:10:27 PDT
[GraphicsContextGLTextureMapperANGLE][WebGL2] webgl/2.0.0/conformance2/query/occlusion-query.html is failing
Comment 1 Fujii Hironori 2022-07-24 18:14:09 PDT
Created attachment 461183 [details]
Patch
Comment 2 Fujii Hironori 2022-07-24 18:20:12 PDT
bug#219486 added GL_EXT_occlusion_query_boolean to GraphicsContextGLCocoa::platformInitialize.
Comment 3 Kenneth Russell 2022-07-25 10:27:10 PDT
Comment on attachment 461183 [details]
Patch

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

> Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:273
> +        requiredExtensions.append("GL_EXT_occlusion_query_boolean"_s);

Occlusion queries are part of the core OpenGL ES 3.0 spec, so it should not be necessary to require this extension in that mode.

Is this class properly requesting a WebGL 2.0 compatible context from ANGLE when WebGL 2.0 is enabled?
Comment 4 Fujii Hironori 2022-07-25 14:19:36 PDT
Comment on attachment 461183 [details]
Patch

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

>> Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:273
>> +        requiredExtensions.append("GL_EXT_occlusion_query_boolean"_s);
> 
> Occlusion queries are part of the core OpenGL ES 3.0 spec, so it should not be necessary to require this extension in that mode.
> 
> Is this class properly requesting a WebGL 2.0 compatible context from ANGLE when WebGL 2.0 is enabled?

Yes. I confirmed it's reaching the code initialing as EGL ver.3 in the test case.
https://github.com/WebKit/WebKit/blob/00e1e0d6e977c7cc204944834d6af3254a1d5e5b/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp#L214-L215

Cocoa port is also setting the extension for WebGL2.
https://github.com/WebKit/WebKit/blob/00e1e0d6e977c7cc204944834d6af3254a1d5e5b/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm#L366-L369

"gl.getQueryParameter(query, gl.QUERY_RESULT_AVAILABLE)" is keeping returning false because the following condition is true.
https://github.com/WebKit/WebKit/blob/00e1e0d6e977c7cc204944834d6af3254a1d5e5b/Source/ThirdParty/ANGLE/src/libANGLE/validationES.cpp#L2625-L2627
Comment 5 Kenneth Russell 2022-07-25 14:44:22 PDT
Comment on attachment 461183 [details]
Patch

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

Looks fine to me. Filed follow-on bug crbug.com/angleproject/7526 to eliminate this requirement. r+

>>> Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:273
>>> +        requiredExtensions.append("GL_EXT_occlusion_query_boolean"_s);
>> 
>> Occlusion queries are part of the core OpenGL ES 3.0 spec, so it should not be necessary to require this extension in that mode.
>> 
>> Is this class properly requesting a WebGL 2.0 compatible context from ANGLE when WebGL 2.0 is enabled?
> 
> Yes. I confirmed it's reaching the code initialing as EGL ver.3 in the test case.
> https://github.com/WebKit/WebKit/blob/00e1e0d6e977c7cc204944834d6af3254a1d5e5b/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp#L214-L215
> 
> Cocoa port is also setting the extension for WebGL2.
> https://github.com/WebKit/WebKit/blob/00e1e0d6e977c7cc204944834d6af3254a1d5e5b/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm#L366-L369
> 
> "gl.getQueryParameter(query, gl.QUERY_RESULT_AVAILABLE)" is keeping returning false because the following condition is true.
> https://github.com/WebKit/WebKit/blob/00e1e0d6e977c7cc204944834d6af3254a1d5e5b/Source/ThirdParty/ANGLE/src/libANGLE/validationES.cpp#L2625-L2627

Thanks, I see - that's surprising. Filed crbug.com/angleproject/7526 to remove this requirement. Looks good given that.
Comment 6 Fujii Hironori 2022-07-25 15:45:08 PDT
Comment on attachment 461183 [details]
Patch

Thank you for the review.
Comment 7 EWS 2022-07-25 16:18:56 PDT
Committed 252804@main (3738ce59df5b): <https://commits.webkit.org/252804@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 461183 [details].
Comment 8 Radar WebKit Bug Importer 2022-07-25 16:19:16 PDT
<rdar://problem/97574968>