Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 1783763002: [WebGL 2] primitive restart should be always enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cbb3969024597af40356116aef19adb2d46f2296..c40c02c1a9b9fc8d0baf1bc33e391aa53a036ffd 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -996,6 +996,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.
contextGL()->Flush();
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698