diff options
author | Brian Paul <brianp@vmware.com> | 2009-08-20 08:06:56 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-08-20 08:06:56 -0600 |
commit | 7a6ec25c9a1b967539dbd92632ef1fa2ec7444b5 (patch) | |
tree | 14794ce8ef5eef5238d7f251a0b10a5f70f7a030 | |
parent | 4d4a904bb087d96e8000c6d56f4ca1c699cd53c9 (diff) |
depthStencil: added cast in pixels/second computation to avoid int overflow
This fixes the negative rates that were sometimes reported.
-rw-r--r-- | src/glean/tdepthstencil.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glean/tdepthstencil.cpp b/src/glean/tdepthstencil.cpp index 54e97df..ad672ef 100644 --- a/src/glean/tdepthstencil.cpp +++ b/src/glean/tdepthstencil.cpp @@ -261,7 +261,8 @@ DepthStencilTest::readPixelsRate(GLenum format, GLenum type) delete [] img; - double rate = width * height * iterations / elapsedTime; + double rate = width * height * (double) iterations / elapsedTime; + assert(rate > 0.0); return rate; // pixels/second } |