{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments/32187402","id":32187402,"diff_hunk":"@@ -57,6 +100,62 @@ int Renderer::getNumberTriangles(){\n     return numberTriangles;\n }\n \n+void swapFrameQueries() {\n+    lastFrameQuery = currentFrameQuery;\n+    currentFrameQuery = !currentFrameQuery;\n+}\n+\n+void Renderer::startGpuTimer(int eye) {\n+    if(!disjointTimerSupported) {\n+        return;\n+    }\n+    glBeginQuery(GL_TIME_ELAPSED_EXT, queries[eye][currentFrameQuery]);\n+}\n+\n+void Renderer::stopGpuTimer(int eye) {\n+    if(!disjointTimerSupported) {\n+        return;\n+    }\n+\n+    glEndQuery(GL_TIME_ELAPSED_EXT);\n+    if(eye == 0 && !monoscopic) {\n+        return;\n+    }\n+\n+    drawTime += getGpuTimerResult(0);\n+    if(!monoscopic) {\n+        drawTime += getGpuTimerResult(1);\n+    }\n+\n+    swapFrameQueries();\n+\n+    frameCount++;\n+    if((frameCount % 10) == 0) {\n+        avgDrawTime = drawTime / 10.0f;\n+        drawTime = 0.0f;\n+    }\n+}\n+\n+float Renderer::getGpuTimerResult(int eye) {\n+    float gpuTime = 0.0f;\n+    glGetQueryObjectuiv(queries[eye][lastFrameQuery], GL_QUERY_RESULT_AVAILABLE, &queriesAvailable);\n+    if(queriesAvailable == 0) {\n+        return gpuTime;\n+    }\n+\n+    glGetIntegerv(GL_GPU_DISJOINT_EXT, &queriesDisjointOccurred);\n+    if(!queriesDisjointOccurred) {\n+        glGetQueryObjectui64vEXT__(queries[eye][lastFrameQuery], GL_QUERY_RESULT, &timeElapsed);\n+        gpuTime = (float) ((double)timeElapsed / 1000000.0);","path":"GVRf/Framework/jni/engine/renderer/renderer.cpp","position":109,"original_position":109,"commit_id":"25d4dc50a59100086e5cc31a782ee79b1b33a4d4","original_commit_id":"25d4dc50a59100086e5cc31a782ee79b1b33a4d4","user":{"login":"thomasflynn","id":9667914,"avatar_url":"https://avatars.githubusercontent.com/u/9667914?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasflynn","html_url":"https://github.com/thomasflynn","followers_url":"https://api.github.com/users/thomasflynn/followers","following_url":"https://api.github.com/users/thomasflynn/following{/other_user}","gists_url":"https://api.github.com/users/thomasflynn/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasflynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasflynn/subscriptions","organizations_url":"https://api.github.com/users/thomasflynn/orgs","repos_url":"https://api.github.com/users/thomasflynn/repos","events_url":"https://api.github.com/users/thomasflynn/events{/privacy}","received_events_url":"https://api.github.com/users/thomasflynn/received_events","type":"User","site_admin":false},"body":"ok, lollipop user-build shows 0ms.  must be an issue on lollipop then.  that sucks.  i can try switching to gpu timestamps rather than using time elapsed.","created_at":"2015-06-11T03:27:54Z","updated_at":"2015-06-11T03:27:54Z","html_url":"https://github.com/Samsung/GearVRf/pull/115#discussion_r32187402","pull_request_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/115","_links":{"self":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments/32187402"},"html":{"href":"https://github.com/Samsung/GearVRf/pull/115#discussion_r32187402"},"pull_request":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/115"}}},"pull_request":{"url":"https://api.github.com/repos/Samsung/GearVRf/pulls/115","id":37003161,"html_url":"https://github.com/Samsung/GearVRf/pull/115","diff_url":"https://github.com/Samsung/GearVRf/pull/115.diff","patch_url":"https://github.com/Samsung/GearVRf/pull/115.patch","issue_url":"https://api.github.com/repos/Samsung/GearVRf/issues/115","number":115,"state":"open","locked":false,"title":"Add stats for gl draw time.","user":{"login":"thomasflynn","id":9667914,"avatar_url":"https://avatars.githubusercontent.com/u/9667914?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasflynn","html_url":"https://github.com/thomasflynn","followers_url":"https://api.github.com/users/thomasflynn/followers","following_url":"https://api.github.com/users/thomasflynn/following{/other_user}","gists_url":"https://api.github.com/users/thomasflynn/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasflynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasflynn/subscriptions","organizations_url":"https://api.github.com/users/thomasflynn/orgs","repos_url":"https://api.github.com/users/thomasflynn/repos","events_url":"https://api.github.com/users/thomasflynn/events{/privacy}","received_events_url":"https://api.github.com/users/thomasflynn/received_events","type":"User","site_admin":false},"body":"Added stats for gl draw time using the disjoint_timer_query extension.\r\n\r\nGearVRf-DCO-1.0-Signed-off-by: Tom Flynn \r\ntom.flynn@samsung.com","created_at":"2015-06-05T06:00:36Z","updated_at":"2015-06-11T03:27:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eaa6ca4fa4e53a962166e488c673054d39fb1312","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/115/commits","review_comments_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/115/comments","review_comment_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/GearVRf/issues/115/comments","statuses_url":"https://api.github.com/repos/Samsung/GearVRf/statuses/25d4dc50a59100086e5cc31a782ee79b1b33a4d4","head":{"label":"thomasflynn:stats3","ref":"stats3","sha":"25d4dc50a59100086e5cc31a782ee79b1b33a4d4","user":{"login":"thomasflynn","id":9667914,"avatar_url":"https://avatars.githubusercontent.com/u/9667914?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasflynn","html_url":"https://github.com/thomasflynn","followers_url":"https://api.github.com/users/thomasflynn/followers","following_url":"https://api.github.com/users/thomasflynn/following{/other_user}","gists_url":"https://api.github.com/users/thomasflynn/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasflynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasflynn/subscriptions","organizations_url":"https://api.github.com/users/thomasflynn/orgs","repos_url":"https://api.github.com/users/thomasflynn/repos","events_url":"https://api.github.com/users/thomasflynn/events{/privacy}","received_events_url":"https://api.github.com/users/thomasflynn/received_events","type":"User","site_admin":false},"repo":{"id":33621617,"name":"GearVRf","full_name":"thomasflynn/GearVRf","owner":{"login":"thomasflynn","id":9667914,"avatar_url":"https://avatars.githubusercontent.com/u/9667914?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasflynn","html_url":"https://github.com/thomasflynn","followers_url":"https://api.github.com/users/thomasflynn/followers","following_url":"https://api.github.com/users/thomasflynn/following{/other_user}","gists_url":"https://api.github.com/users/thomasflynn/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasflynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasflynn/subscriptions","organizations_url":"https://api.github.com/users/thomasflynn/orgs","repos_url":"https://api.github.com/users/thomasflynn/repos","events_url":"https://api.github.com/users/thomasflynn/events{/privacy}","received_events_url":"https://api.github.com/users/thomasflynn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thomasflynn/GearVRf","description":"The GearVR framework(GearVRf) is an Open Source VR rendering library for application development on VR-supported Android devices. ","fork":true,"url":"https://api.github.com/repos/thomasflynn/GearVRf","forks_url":"https://api.github.com/repos/thomasflynn/GearVRf/forks","keys_url":"https://api.github.com/repos/thomasflynn/GearVRf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thomasflynn/GearVRf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thomasflynn/GearVRf/teams","hooks_url":"https://api.github.com/repos/thomasflynn/GearVRf/hooks","issue_events_url":"https://api.github.com/repos/thomasflynn/GearVRf/issues/events{/number}","events_url":"https://api.github.com/repos/thomasflynn/GearVRf/events","assignees_url":"https://api.github.com/repos/thomasflynn/GearVRf/assignees{/user}","branches_url":"https://api.github.com/repos/thomasflynn/GearVRf/branches{/branch}","tags_url":"https://api.github.com/repos/thomasflynn/GearVRf/tags","blobs_url":"https://api.github.com/repos/thomasflynn/GearVRf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thomasflynn/GearVRf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thomasflynn/GearVRf/git/refs{/sha}","trees_url":"https://api.github.com/repos/thomasflynn/GearVRf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thomasflynn/GearVRf/statuses/{sha}","languages_url":"https://api.github.com/repos/thomasflynn/GearVRf/languages","stargazers_url":"https://api.github.com/repos/thomasflynn/GearVRf/stargazers","contributors_url":"https://api.github.com/repos/thomasflynn/GearVRf/contributors","subscribers_url":"https://api.github.com/repos/thomasflynn/GearVRf/subscribers","subscription_url":"https://api.github.com/repos/thomasflynn/GearVRf/subscription","commits_url":"https://api.github.com/repos/thomasflynn/GearVRf/commits{/sha}","git_commits_url":"https://api.github.com/repos/thomasflynn/GearVRf/git/commits{/sha}","comments_url":"https://api.github.com/repos/thomasflynn/GearVRf/comments{/number}","issue_comment_url":"https://api.github.com/repos/thomasflynn/GearVRf/issues/comments{/number}","contents_url":"https://api.github.com/repos/thomasflynn/GearVRf/contents/{+path}","compare_url":"https://api.github.com/repos/thomasflynn/GearVRf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thomasflynn/GearVRf/merges","archive_url":"https://api.github.com/repos/thomasflynn/GearVRf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thomasflynn/GearVRf/downloads","issues_url":"https://api.github.com/repos/thomasflynn/GearVRf/issues{/number}","pulls_url":"https://api.github.com/repos/thomasflynn/GearVRf/pulls{/number}","milestones_url":"https://api.github.com/repos/thomasflynn/GearVRf/milestones{/number}","notifications_url":"https://api.github.com/repos/thomasflynn/GearVRf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thomasflynn/GearVRf/labels{/name}","releases_url":"https://api.github.com/repos/thomasflynn/GearVRf/releases{/id}","created_at":"2015-04-08T17:30:11Z","updated_at":"2015-05-07T21:22:53Z","pushed_at":"2015-06-11T02:05:33Z","git_url":"git://github.com/thomasflynn/GearVRf.git","ssh_url":"git@github.com:thomasflynn/GearVRf.git","clone_url":"https://github.com/thomasflynn/GearVRf.git","svn_url":"https://github.com/thomasflynn/GearVRf","homepage":"http://www.gearvrf.org","size":199042,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Samsung:master","ref":"master","sha":"6d866787353c1d1422fddcb374c6a3b8344237bc","user":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"repo":{"id":32836701,"name":"GearVRf","full_name":"Samsung/GearVRf","owner":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Samsung/GearVRf","description":"The GearVR framework(GearVRf) is an Open Source VR rendering library for application development on VR-supported Android devices. ","fork":false,"url":"https://api.github.com/repos/Samsung/GearVRf","forks_url":"https://api.github.com/repos/Samsung/GearVRf/forks","keys_url":"https://api.github.com/repos/Samsung/GearVRf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Samsung/GearVRf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Samsung/GearVRf/teams","hooks_url":"https://api.github.com/repos/Samsung/GearVRf/hooks","issue_events_url":"https://api.github.com/repos/Samsung/GearVRf/issues/events{/number}","events_url":"https://api.github.com/repos/Samsung/GearVRf/events","assignees_url":"https://api.github.com/repos/Samsung/GearVRf/assignees{/user}","branches_url":"https://api.github.com/repos/Samsung/GearVRf/branches{/branch}","tags_url":"https://api.github.com/repos/Samsung/GearVRf/tags","blobs_url":"https://api.github.com/repos/Samsung/GearVRf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Samsung/GearVRf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Samsung/GearVRf/git/refs{/sha}","trees_url":"https://api.github.com/repos/Samsung/GearVRf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Samsung/GearVRf/statuses/{sha}","languages_url":"https://api.github.com/repos/Samsung/GearVRf/languages","stargazers_url":"https://api.github.com/repos/Samsung/GearVRf/stargazers","contributors_url":"https://api.github.com/repos/Samsung/GearVRf/contributors","subscribers_url":"https://api.github.com/repos/Samsung/GearVRf/subscribers","subscription_url":"https://api.github.com/repos/Samsung/GearVRf/subscription","commits_url":"https://api.github.com/repos/Samsung/GearVRf/commits{/sha}","git_commits_url":"https://api.github.com/repos/Samsung/GearVRf/git/commits{/sha}","comments_url":"https://api.github.com/repos/Samsung/GearVRf/comments{/number}","issue_comment_url":"https://api.github.com/repos/Samsung/GearVRf/issues/comments{/number}","contents_url":"https://api.github.com/repos/Samsung/GearVRf/contents/{+path}","compare_url":"https://api.github.com/repos/Samsung/GearVRf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Samsung/GearVRf/merges","archive_url":"https://api.github.com/repos/Samsung/GearVRf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Samsung/GearVRf/downloads","issues_url":"https://api.github.com/repos/Samsung/GearVRf/issues{/number}","pulls_url":"https://api.github.com/repos/Samsung/GearVRf/pulls{/number}","milestones_url":"https://api.github.com/repos/Samsung/GearVRf/milestones{/number}","notifications_url":"https://api.github.com/repos/Samsung/GearVRf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Samsung/GearVRf/labels{/name}","releases_url":"https://api.github.com/repos/Samsung/GearVRf/releases{/id}","created_at":"2015-03-25T02:02:18Z","updated_at":"2015-06-08T12:56:24Z","pushed_at":"2015-06-11T00:20:56Z","git_url":"git://github.com/Samsung/GearVRf.git","ssh_url":"git@github.com:Samsung/GearVRf.git","clone_url":"https://github.com/Samsung/GearVRf.git","svn_url":"https://github.com/Samsung/GearVRf","homepage":"http://www.gearvrf.org","size":222786,"stargazers_count":25,"watchers_count":25,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":41,"forks":27,"open_issues":41,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/115"},"html":{"href":"https://github.com/Samsung/GearVRf/pull/115"},"issue":{"href":"https://api.github.com/repos/Samsung/GearVRf/issues/115"},"comments":{"href":"https://api.github.com/repos/Samsung/GearVRf/issues/115/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/115/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/115/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/GearVRf/statuses/25d4dc50a59100086e5cc31a782ee79b1b33a4d4"}}}}