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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1783763002: [WebGL 2] primitive restart should be always enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cache max_value and max_value_primitive_restart_enabled for each range 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
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 5a0bfcb6f9ff5b278fd104149c67f368b88ac648..8d49b6524aedbcd3c7fc92bed5e13d7c67d1c7e6 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -6154,12 +6154,30 @@ void GLES2DecoderImpl::DoFramebufferRenderbuffer(
}
void GLES2DecoderImpl::DoDisable(GLenum cap) {
+ if (cap == GL_PRIMITIVE_RESTART_FIXED_INDEX) {
+ // TODO(Yunchao): crbug.com/594021
+ // On Desktop GL with versions lower than 4.3, we need to emulate
+ // GL_PRIMITIVE_RESTART_FIXED_INDEX using glPrimitiveRestartIndex().
+ if (feature_info_->feature_flags().emulate_primitive_restart_fixed_index) {
+ return;
Ken Russell (switch to Gerrit) 2016/03/19 00:06:41 This short-circuit here and in DoEnable looks wron
+ }
+ buffer_manager()->SetPrimitiveRestartState(false);
+ }
if (SetCapabilityState(cap, false)) {
glDisable(cap);
}
}
void GLES2DecoderImpl::DoEnable(GLenum cap) {
+ if (cap == GL_PRIMITIVE_RESTART_FIXED_INDEX) {
+ // TODO(Yunchao): crbug.com/594021
+ // On Desktop GL with versions lower than 4.3, we need to emulate
+ // GL_PRIMITIVE_RESTART_FIXED_INDEX using glPrimitiveRestartIndex().
+ if (feature_info_->feature_flags().emulate_primitive_restart_fixed_index) {
+ return;
+ }
+ buffer_manager()->SetPrimitiveRestartState(true);
+ }
if (SetCapabilityState(cap, true)) {
glEnable(cap);
}
« no previous file with comments | « gpu/command_buffer/service/buffer_manager.cc ('k') | third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698