Clamp texture queries to sane values.

Some device's concept of time might be off.
To prevent corrupt texture runtime measurements from corrupting
the texture upload logic, we clamp the runtimes to the range
of [1,15000] microseconds.

If the corrupt runtimes are 0, this patch will effectively cause
us to always upload all pending textures.

This is a workaround until the async texture upload feature lands.

BUG=162699


Review URL: https://chromiumcodereview.appspot.com/11434111

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171108 0039d316-1c4b-4281-b951-d872f2087c98
parent 3699ae5a
...@@ -353,6 +353,10 @@ void TextureUploader::processQueries() ...@@ -353,6 +353,10 @@ void TextureUploader::processQueries()
unsigned usElapsed = m_pendingQueries.first()->value(); unsigned usElapsed = m_pendingQueries.first()->value();
HISTOGRAM_CUSTOM_COUNTS("Renderer4.TextureGpuUploadTimeUS", usElapsed, 0, 100000, 50); HISTOGRAM_CUSTOM_COUNTS("Renderer4.TextureGpuUploadTimeUS", usElapsed, 0, 100000, 50);
// Clamp the queries to saner values in case the queries fail.
usElapsed = std::max(1u, usElapsed);
usElapsed = std::min(15000u, usElapsed);
if (!m_pendingQueries.first()->isNonBlocking()) if (!m_pendingQueries.first()->isNonBlocking())
m_numBlockingTextureUploads--; m_numBlockingTextureUploads--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment