WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
205618
Add support for iOS Simulator to ANGLE backend for WebGL
https://bugs.webkit.org/show_bug.cgi?id=205618
Summary
Add support for iOS Simulator to ANGLE backend for WebGL
Kenneth Russell
Reported
2019-12-28 13:59:02 PST
In
bug 205483
WebKit's WebGL implementation was switched to use ANGLE on all Cocoa platforms except for the iOS simulator, because while IOSurfaces are now supported on that platform, [EAGLContext texImageIOSurface:...] is not. It looks like this can be emulated inside ANGLE's eglBindTexImage / eglReleaseTexImage entry points and thereby add support for the iOS simulator platform.
Attachments
Work-in-progress
(16.41 KB, patch)
2019-12-30 13:46 PST
,
Kenneth Russell
no flags
Details
Formatted Diff
Diff
Work-in-progress
(16.67 KB, patch)
2019-12-30 18:02 PST
,
Kenneth Russell
no flags
Details
Formatted Diff
Diff
Patch
(25.24 KB, patch)
2019-12-31 19:28 PST
,
Kenneth Russell
no flags
Details
Formatted Diff
Diff
Patch
(25.33 KB, patch)
2020-01-03 14:01 PST
,
Kenneth Russell
dino
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Kenneth Russell
Comment 1
2019-12-30 13:46:50 PST
Created
attachment 386546
[details]
Work-in-progress
EWS Watchlist
Comment 2
2019-12-30 13:47:27 PST
Note that there are important steps to take when updating ANGLE. See
http://trac.webkit.org/wiki/UpdatingANGLE
Kenneth Russell
Comment 3
2019-12-30 13:48:18 PST
This work-in-progress crashes the content process while running in the iOS Simulator. I'm still trying to figure out how to attach an lldb to the process in the simulator - dino@ pointed out that I should try attaching to com.apple.WebKit.WebContent.Development .
Kenneth Russell
Comment 4
2019-12-30 16:26:52 PST
Inserted a 20 second pause during GraphicsContext3D creation and got Xcode to attach to the com.apple.WebKit.WebContent.Development process when the simulator was launched from the command line. Stack trace follows. Still debugging. #0 0x0000000235e1c411 in gl::LogMessage::~LogMessage() at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/common/debug.cpp:183 #1 0x0000000235e1c1d5 in gl::LogMessage::~LogMessage() at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/common/debug.cpp:159 #2 0x0000000236287d43 in gl::Texture::getSamples(gl::TextureTarget, unsigned long) const at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/libANGLE/Texture.cpp:958 #3 0x000000023628d6d4 in gl::Texture::getAttachmentSamples(gl::ImageIndex const&) const at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/libANGLE/Texture.cpp:1628 #4 0x0000000235d46058 in gl::FramebufferAttachment::getResourceSamples() const at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/libANGLE/FramebufferAttachment.h:256 #5 0x0000000235d40450 in gl::FramebufferAttachment::getSamples() const at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/libANGLE/FramebufferAttachment.h:250 #6 0x0000000235ffd73f in gl::(anonymous namespace)::CheckAttachmentSampleCompleteness(gl::Context const*, gl::FramebufferAttachment const&, bool, Optional<int>*, Optional<bool>*, Optional<int>*) at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/libANGLE/Framebuffer.cpp:189 #7 0x0000000235ffc0ee in gl::Framebuffer::checkStatusWithGLFrontEnd(gl::Context const*) at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/libANGLE/Framebuffer.cpp:1117 #8 0x0000000235ffbcf7 in gl::Framebuffer::checkStatusImpl(gl::Context const*) at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/libANGLE/Framebuffer.cpp:1061 #9 0x0000000235dc90bf in gl::Framebuffer::checkStatus(gl::Context const*) at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/libANGLE/Framebuffer.h:283 #10 0x0000000235dc8ee2 in gl::Context::checkFramebufferStatus(unsigned int) at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/libANGLE/Context.cpp:6168 #11 0x0000000235eaea0f in gl::CheckFramebufferStatus(unsigned int) at /Users/kbr/src/iOSWebKit/Source/ThirdParty/ANGLE/src/libGLESv2/entry_points_gles_2_0_autogen.cpp:338 #12 0x00000002208af400 in WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded(unsigned int, int, int) at /Users/kbr/src/iOSWebKit/Source/WebCore/platform/graphics/angle/GraphicsContext3DANGLE.cpp:251 #13 0x00000002208af207 in WebCore::GraphicsContext3D::reshapeFBOs(WebCore::IntSize const&) at /Users/kbr/src/iOSWebKit/Source/WebCore/platform/graphics/angle/GraphicsContext3DANGLE.cpp:216 #14 0x00000002208b0b70 in WebCore::GraphicsContext3D::reshape(int, int) at /Users/kbr/src/iOSWebKit/Source/WebCore/platform/graphics/angle/GraphicsContext3DANGLE.cpp:578 #15 0x000000022320a03f in WebCore::WebGLRenderingContextBase::initializeNewContext() at /Users/kbr/src/iOSWebKit/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:783 #16 0x00000002231fd51d in WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase(WebCore::CanvasBase&, WTF::Ref<WebCore::GraphicsContext3D, WTF::DumbPtrTraits<WebCore::GraphicsContext3D> >&&, WebCore::GraphicsContext3DAttributes) at /Users/kbr/src/iOSWebKit/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:653
Kenneth Russell
Comment 5
2019-12-30 18:02:34 PST
Created
attachment 386547
[details]
Work-in-progress
Kenneth Russell
Comment 6
2019-12-30 18:03:49 PST
Fixed the crash, which was caused by a mismatch between the use of the TEXTURE_2D and TEXTURE_RECTANGLE_ANGLE texture targets. (The same problem probably exists in the on-device iOS port.) Still doesn't render anything yet.
Kenneth Russell
Comment 7
2019-12-31 19:28:38 PST
Created
attachment 386570
[details]
Patch
Kenneth Russell
Comment 8
2019-12-31 19:29:04 PST
The current patch
Kenneth Russell
Comment 9
2019-12-31 19:31:20 PST
Thanks to more hints from dino@, the current patch seems to be working! At least, it did in a debug build just before rebasing on ToT. Will test more locally. dino@, could you please help testing this on-device and making sure it doesn't break that code path? I believe it should only make that code path more correct, rather than regressing anything. Thanks!
Kenneth Russell
Comment 10
2020-01-03 14:01:23 PST
Created
attachment 386713
[details]
Patch
Kenneth Russell
Comment 11
2020-01-03 14:02:37 PST
Fixed the compile failure on iOS and changed the newly-allocated enum for the usage hint.
Dean Jackson
Comment 12
2020-01-05 09:59:04 PST
Committed
r254036
: <
https://trac.webkit.org/changeset/254036
>
Radar WebKit Bug Importer
Comment 13
2020-01-05 10:00:18 PST
<
rdar://problem/58325954
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug