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

Unified Diff: gpu/command_buffer/service/feature_info.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.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/feature_info.cc
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index 897afd3477adb3a314093c8849077a6d1b1fc9b3..24529540b09befa850fb74b65eb2905dfe2b9228 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -1052,6 +1052,27 @@ void FeatureInfo::InitializeFeatures() {
#endif
}
+bool FeatureInfo::IsES3Capable() const {
+ if (gl_version_info_->IsAtLeastGLES(3, 0))
+ return true;
+ // TODO(zmo): For Desktop GL, with anything lower than 4.2, we need to check
+ // the existence of a few extensions to have full WebGL 2 capabilities.
+ if (gl_version_info_->IsAtLeastGL(4, 2))
+ return true;
+#if defined(OS_MACOSX)
+ // TODO(zmo): For experimentation purpose on MacOSX with core profile,
+ // allow 3.2 or plus for now.
+ if (gl_version_info_->IsAtLeastGL(3, 2))
+ return true;
+#endif
+ return false;
+}
+
+void FeatureInfo::EnableES3Validators() {
+ DCHECK(IsES3Capable());
+ validators_.AddES3Values();
+}
+
void FeatureInfo::AddExtensionString(const char* s) {
std::string str(s);
size_t pos = extensions_.find(str);
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698