Index: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
index 2cca13e6b021fb94925c95a750cdcefb21fbbc8d..e3111ec903e7956ba3d7c9e9b6c260f1f37787fb 100644 |
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
@@ -995,6 +995,12 @@ void WebGLRenderingContextBase::initializeNewContext() |
webContext()->setContextLostCallback(m_contextLostCallbackAdapter.get()); |
webContext()->setErrorMessageCallback(m_errorMessageCallbackAdapter.get()); |
+ // If WebGL 2, the PRIMITIVE_RESTART_FIXED_INDEX should be always enabled. |
+ // See the section <Primitive Restart is Always Enabled> in WebGL 2 spec: |
+ // https://www.khronos.org/registry/webgl/specs/latest/2.0/#4.1.4 |
+ if (isWebGL2OrHigher()) |
+ contextGL()->Enable(GL_PRIMITIVE_RESTART_FIXED_INDEX); |
+ |
// This ensures that the context has a valid "lastFlushID" and won't be mistakenly identified as the "least recently used" context. |
webContext()->flush(); |