Commit e95e2c3c by Jamie Madill Committed by Commit Bot

Add timer and frame counter to SimpleTexture2D.

Can be useful for perf testing. Bug: angleproject:4729 Change-Id: I26c5fd53a34f4ed21d565e020b7c2058ff7ee6db Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2241621Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 46594c96
......@@ -61,6 +61,8 @@ void main()
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
mTimer.start();
return true;
}
......@@ -110,6 +112,14 @@ void main()
glUniform1i(mSamplerLoc, 0);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices);
mDrawCount++;
if (mDrawCount % 100 == 0)
{
printf("Rate: %0.2lf iterations / second\n",
static_cast<double>(mDrawCount) / mTimer.getElapsedTime());
}
}
private:
......@@ -125,6 +135,9 @@ void main()
// Texture handle
GLuint mTexture;
Timer mTimer;
uint32_t mDrawCount = 0;
};
int main(int argc, char **argv)
......
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