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

Unified Diff: ui/gl/gpu_timing.cc

Issue 1687353002: Force time elapsed queries on certain drivers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial patch Created 4 years, 10 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gpu_timing.cc
diff --git a/ui/gl/gpu_timing.cc b/ui/gl/gpu_timing.cc
index c6e574ac578efcc96906398f92076d150a3a55ee..d8c0127d7939ec397b45dfca5db00534f34df1c1 100644
--- a/ui/gl/gpu_timing.cc
+++ b/ui/gl/gpu_timing.cc
@@ -317,9 +317,16 @@ GPUTimingImpl::GPUTimingImpl(GLContextReal* context) {
DCHECK(context);
const GLVersionInfo* version_info = context->GetVersionInfo();
DCHECK(version_info);
- if (version_info->is_es3 && // glGetInteger64v is supported under ES3.
- context->HasExtension("GL_EXT_disjoint_timer_query")) {
+ if (context->HasExtension("GL_EXT_disjoint_timer_query")) {
timer_type_ = GPUTiming::kTimerTypeDisjoint;
+ if (!version_info->is_es3) {
+ // Due to a bug in the specification, glGetInteger64v is only supported
+ // under ES3. Since it is only used for timestamps, we workaround this by
+ // emulating timestamps on ES2 so WebGL 1.0 will still have access to the
+ // extension
+ force_time_elapsed_query_ = true;
+ timestamp_bit_count_gl_ = 0;
+ }
} else if (context->HasExtension("GL_ARB_timer_query")) {
timer_type_ = GPUTiming::kTimerTypeARB;
} else if (context->HasExtension("GL_EXT_timer_query")) {
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698