-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGL resource creation is not robust against context loss #16923
WebGL resource creation is not robust against context loss #16923
Conversation
EWS run on previous version of this PR (hash 5517dea) |
5517dea
to
6075694
Compare
EWS run on previous version of this PR (hash 6075694)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto object = context.graphicsContextGL()->createSampler(); | ||
if (!object) | ||
return nullptr; | ||
return adoptRef(*new WebGLSampler { context, object }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern feels like something that should be automated.
6075694
to
92f1aaa
Compare
EWS run on previous version of this PR (hash 92f1aaa)
|
92f1aaa
to
13c496d
Compare
EWS run on current version of this PR (hash 13c496d)
|
https://bugs.webkit.org/show_bug.cgi?id=260513 rdar://problem/114245538 Reviewed by Dan Glastonbury. At the moment, the various GraphicsContextGL::create{Resource}() calls might return 0 if the context is lost during that call. Handle this in all the WebGL resource constructors. Return RefPtr and handle the nullptr in the caller. * Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp: (WebCore::WebXROpaqueFramebuffer::create): * Source/WebCore/html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::fenceSync): * Source/WebCore/html/canvas/WebGLBuffer.cpp: (WebCore::WebGLBuffer::create): (WebCore::WebGLBuffer::WebGLBuffer): * Source/WebCore/html/canvas/WebGLBuffer.h: * Source/WebCore/html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::create): (WebCore::WebGLFramebuffer::createOpaque): (WebCore::WebGLFramebuffer::WebGLFramebuffer): * Source/WebCore/html/canvas/WebGLFramebuffer.h: * Source/WebCore/html/canvas/WebGLObject.cpp: (WebCore::WebGLObject::WebGLObject): (WebCore::WebGLObject::setObject): Deleted. * Source/WebCore/html/canvas/WebGLObject.h: * Source/WebCore/html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::create): (WebCore::WebGLProgram::WebGLProgram): * Source/WebCore/html/canvas/WebGLProgram.h: * Source/WebCore/html/canvas/WebGLQuery.cpp: (WebCore::WebGLQuery::create): (WebCore::WebGLQuery::WebGLQuery): * Source/WebCore/html/canvas/WebGLQuery.h: * Source/WebCore/html/canvas/WebGLRenderbuffer.cpp: (WebCore::WebGLRenderbuffer::create): (WebCore::WebGLRenderbuffer::WebGLRenderbuffer): * Source/WebCore/html/canvas/WebGLRenderbuffer.h: * Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::createProgram): * Source/WebCore/html/canvas/WebGLSampler.cpp: (WebCore::WebGLSampler::create): (WebCore::WebGLSampler::WebGLSampler): * Source/WebCore/html/canvas/WebGLSampler.h: * Source/WebCore/html/canvas/WebGLShader.cpp: (WebCore::WebGLShader::create): (WebCore::WebGLShader::WebGLShader): * Source/WebCore/html/canvas/WebGLShader.h: * Source/WebCore/html/canvas/WebGLSync.cpp: (WebCore::WebGLSync::create): (WebCore::WebGLSync::WebGLSync): (WebCore::m_sync): (WebCore::WebGLSync::deleteObjectImpl): * Source/WebCore/html/canvas/WebGLSync.h: * Source/WebCore/html/canvas/WebGLTexture.cpp: (WebCore::WebGLTexture::create): (WebCore::WebGLTexture::WebGLTexture): * Source/WebCore/html/canvas/WebGLTexture.h: * Source/WebCore/html/canvas/WebGLTimerQueryEXT.cpp: (WebCore::WebGLTimerQueryEXT::create): (WebCore::WebGLTimerQueryEXT::WebGLTimerQueryEXT): * Source/WebCore/html/canvas/WebGLTimerQueryEXT.h: * Source/WebCore/html/canvas/WebGLTransformFeedback.cpp: (WebCore::WebGLTransformFeedback::create): (WebCore::WebGLTransformFeedback::WebGLTransformFeedback): * Source/WebCore/html/canvas/WebGLTransformFeedback.h: * Source/WebCore/html/canvas/WebGLVertexArrayObject.cpp: (WebCore::WebGLVertexArrayObject::create): (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): * Source/WebCore/html/canvas/WebGLVertexArrayObject.h: * Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp: (WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase): * Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h: * Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp: (WebCore::WebGLVertexArrayObjectOES::createDefault): (WebCore::WebGLVertexArrayObjectOES::createUser): (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES): * Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h: Canonical link: https://commits.webkit.org/267183@main
Committed 267183@main (6a55c5e): https://commits.webkit.org/267183@main Reviewed commits have been landed. Closing PR #16923 and removing active labels. |
13c496d
to
6a55c5e
Compare
6a55c5e
13c496d
🧪 wpe-wk2