New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 595172 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Disable timestamp support in WebGL in EXT_disjoint_timer_query

Project Member Reported by ewell@google.com, Mar 16 2016

Issue description

The underlying driver support for timestamps in EXT_disjoint_timer_query is very small with Mac and Windows under D3D11 not supporting timestamps at all and Android support being flaky. Time elapsed queries are much more widely supported and therefore should be used instead by WebGL developers. Therefore timestamps should be disabled by setting the query counter bits count for timestamps to 0 and returning 0 for every timestamp query.
 
I tried out this extension in Canary. Time stamps and elapsed queries both worked for me on Windows 8.1.

I think time stamp queries are much more versatile than elapsed queries because nested elapsed queries are not allowed. I would like to measure the complete time for a frame as well as the time for some individual draw calls, which would be more complicated with non-nested elapsed queries. Also see discussion on timer_query on the webgl mailing list, e.g. https://www.khronos.org/webgl/public-mailing-list/archives/1304/msg00013.php

There was, however, a strange behavior, that in about 20% of the cases the time for the same draw call, measured with an elapsed and two time stamp queries, was exactly different by 1ms, while in 78% percent of the cases the result was identical measured in micro seconds. 

Comment 2 by ewell@google.com, Mar 23 2016

In the current implementation, time elapsed queries should go directly to ANGLE (on Windows) and use D3D11 timer queries to implement timing functionality. Timestamps on Windows are currently emulated using CPU time in the majority of cases, which kinda defeats the purpose of GPU timing. Unfortunately, D3D11 timer queries are at a higher level than GL timestamp queries which makes implementing GL timestamp queries on top of D3D11 in a decent way nearly impossible. In addition Mac OS X only supports elapsed timer queries. I agree it is not ideal, but it should be possible to implement detailed timing functionality by making a class to calculate timestamps by summing multiple elapsed timer queries.
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/060c3ffdab49471143081a9ecc776e4c25a955e7

commit 060c3ffdab49471143081a9ecc776e4c25a955e7
Author: ewell <ewell@google.com>
Date: Tue Mar 29 21:05:50 2016

Disable timestamps in WebGL.

The timestamp portion of the EXT_disjoint_timer_query does not have much
support from GPU drivers and emulation of them by Chromium at a level
that is accurate enough for users has been determined to be infeasible.
Therefore timestamps are disabled at the WebGL/client side on all
platforms as time elasped queries should be used by developers instead
as they are more widely supported.

BUG= 595172 
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review URL: https://codereview.chromium.org/1800383002

Cr-Commit-Position: refs/heads/master@{#383822}

[modify] https://crrev.com/060c3ffdab49471143081a9ecc776e4c25a955e7/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
[modify] https://crrev.com/060c3ffdab49471143081a9ecc776e4c25a955e7/gpu/command_buffer/client/gles2_implementation.cc
[modify] https://crrev.com/060c3ffdab49471143081a9ecc776e4c25a955e7/third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQuery.cpp
[modify] https://crrev.com/060c3ffdab49471143081a9ecc776e4c25a955e7/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/060c3ffdab49471143081a9ecc776e4c25a955e7/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.cpp

Comment 4 by ewell@google.com, Mar 29 2016

Status: Fixed (was: Assigned)

Sign in to add a comment