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

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

Issue 987123003: Add a mechanism for command buffer to conditionally allow ES3 enums. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/feature_info.cc ('k') | gpu/command_buffer/service/gles2_cmd_validation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f76c085eb35b97d269bc5549fb29b0996e1b7a48..28c1e0f0c2d865043ad09ccf754650e360148749 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2474,14 +2474,6 @@ bool GLES2DecoderImpl::Initialize(
set_log_commands(true);
}
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableUnsafeES3APIs) &&
- attrib_parser.es3_context_required) {
- // TODO(zmo): We need to implement capabilities check to ensure we can
- // actually create ES3 contexts.
- set_unsafe_es3_apis_enabled(true);
- }
-
compile_shader_always_succeeds_ =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kCompileShaderAlwaysSucceeds);
@@ -2516,6 +2508,14 @@ bool GLES2DecoderImpl::Initialize(
}
CHECK_GL_ERROR();
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableUnsafeES3APIs) &&
+ attrib_parser.es3_context_required &&
+ feature_info_->IsES3Capable()) {
+ feature_info_->EnableES3Validators();
+ set_unsafe_es3_apis_enabled(true);
+ }
+
disallowed_features_ = disallowed_features;
state_.attrib_values.resize(group_->max_vertex_attribs());
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | gpu/command_buffer/service/gles2_cmd_validation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698