Title: [232450] trunk/Source/WebCore
- Revision
- 232450
- Author
- [email protected]
- Date
- 2018-06-03 10:35:41 -0700 (Sun, 03 Jun 2018)
Log Message
[WebGL] GL_EXT_robustness utilization should depend on CONTEXT_ROBUST_ACCESS value
https://bugs.webkit.org/show_bug.cgi?id=186187
Reviewed by Carlos Garcia Campos.
Don't utilize the GL_EXT_robustness extension for reading pixels from
the GPU if the underlying OpenGL context did not enable robust access
support upon creation. For EGL contexts, this would be done by passing
EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT and EGL_TRUE key-value pair in the
attribute list passed to eglCreateContext() (as specified in the
EGL_EXT_create_context_robustness extension), but at the moment this
capability is not utilized.
As such, on drivers that implement GL_EXT_robustness support, pixel
reads done in WebGLRenderingContextBase end up using glReadnPixels(),
but that fails to successfully read anything due to the context
rejecting such calls.
GL_EXT_robustness is specific to OpenGL ES versions, so to fix this,
Extensions3DOpenGLES overrides the isEnabled() method. That override
returns false immediately if the inherited isEnabled() implementation
returns false. Otherwise it returns true, unless the tested extension
is GL_EXT_robustness, in which case we now check that the context's
CONTEXT_ROBUST_ACCESS state value is true, meaning the context was
created with robust access support enabled.
No new tests are possible because this is optional driver-provided
functionality that Web content cannot have effect on.
* platform/graphics/Extensions3D.h:
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
(WebCore::Extensions3DOpenGLES::isEnabled):
* platform/graphics/opengl/Extensions3DOpenGLES.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (232449 => 232450)
--- trunk/Source/WebCore/ChangeLog 2018-06-03 02:22:45 UTC (rev 232449)
+++ trunk/Source/WebCore/ChangeLog 2018-06-03 17:35:41 UTC (rev 232450)
@@ -1,3 +1,39 @@
+2018-06-03 Zan Dobersek <[email protected]>
+
+ [WebGL] GL_EXT_robustness utilization should depend on CONTEXT_ROBUST_ACCESS value
+ https://bugs.webkit.org/show_bug.cgi?id=186187
+
+ Reviewed by Carlos Garcia Campos.
+
+ Don't utilize the GL_EXT_robustness extension for reading pixels from
+ the GPU if the underlying OpenGL context did not enable robust access
+ support upon creation. For EGL contexts, this would be done by passing
+ EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT and EGL_TRUE key-value pair in the
+ attribute list passed to eglCreateContext() (as specified in the
+ EGL_EXT_create_context_robustness extension), but at the moment this
+ capability is not utilized.
+
+ As such, on drivers that implement GL_EXT_robustness support, pixel
+ reads done in WebGLRenderingContextBase end up using glReadnPixels(),
+ but that fails to successfully read anything due to the context
+ rejecting such calls.
+
+ GL_EXT_robustness is specific to OpenGL ES versions, so to fix this,
+ Extensions3DOpenGLES overrides the isEnabled() method. That override
+ returns false immediately if the inherited isEnabled() implementation
+ returns false. Otherwise it returns true, unless the tested extension
+ is GL_EXT_robustness, in which case we now check that the context's
+ CONTEXT_ROBUST_ACCESS state value is true, meaning the context was
+ created with robust access support enabled.
+
+ No new tests are possible because this is optional driver-provided
+ functionality that Web content cannot have effect on.
+
+ * platform/graphics/Extensions3D.h:
+ * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
+ (WebCore::Extensions3DOpenGLES::isEnabled):
+ * platform/graphics/opengl/Extensions3DOpenGLES.h:
+
2018-06-01 Ryosuke Niwa <[email protected]>
Editor can hold references to Documents after you navigate away
Modified: trunk/Source/WebCore/platform/graphics/Extensions3D.h (232449 => 232450)
--- trunk/Source/WebCore/platform/graphics/Extensions3D.h 2018-06-03 02:22:45 UTC (rev 232449)
+++ trunk/Source/WebCore/platform/graphics/Extensions3D.h 2018-06-03 17:35:41 UTC (rev 232450)
@@ -109,6 +109,7 @@
GUILTY_CONTEXT_RESET_ARB = 0x8253,
INNOCENT_CONTEXT_RESET_ARB = 0x8254,
UNKNOWN_CONTEXT_RESET_ARB = 0x8255,
+ CONTEXT_ROBUST_ACCESS = 0x90F3,
// GL_EXT/OES_packed_depth_stencil enums
DEPTH24_STENCIL8 = 0x88F0,
Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp (232449 => 232450)
--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp 2018-06-03 02:22:45 UTC (rev 232449)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp 2018-06-03 17:35:41 UTC (rev 232450)
@@ -66,6 +66,23 @@
Extensions3DOpenGLES::~Extensions3DOpenGLES() = default;
+bool Extensions3DOpenGLES::isEnabled(const String& name)
+{
+ // Return false immediately if the extension is not supported by the drivers.
+ bool enabled = Extensions3DOpenGLCommon::isEnabled(name);
+ if (!enabled)
+ return false;
+
+ // For GL_EXT_robustness, check that the context supports robust access.
+ if (name == "GL_EXT_robustness") {
+ GLint robustAccess = GL_FALSE;
+ m_context->getIntegerv(Extensions3D::CONTEXT_ROBUST_ACCESS, &robustAccess);
+ return robustAccess == GL_TRUE;
+ }
+
+ return true;
+}
+
void Extensions3DOpenGLES::framebufferTexture2DMultisampleIMG(unsigned long target, unsigned long attachment, unsigned long textarget, unsigned int texture, int level, unsigned long samples)
{
if (m_glFramebufferTexture2DMultisampleIMG)
Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h (232449 => 232450)
--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h 2018-06-03 02:22:45 UTC (rev 232449)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h 2018-06-03 17:35:41 UTC (rev 232450)
@@ -71,6 +71,8 @@
Extensions3DOpenGLES(GraphicsContext3D*, bool useIndexedGetString);
virtual ~Extensions3DOpenGLES();
+ bool isEnabled(const String&) override;
+
virtual void framebufferTexture2DMultisampleIMG(unsigned long target, unsigned long attachment, unsigned long textarget, unsigned int texture, int level, unsigned long samples);
virtual void renderbufferStorageMultisampleIMG(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes