Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Issue 2384593002: Encode frame number in pixel data for pose sync (Closed)

Created:
4 years, 2 months ago by klausw
Modified:
4 years, 2 months ago
CC:
chromium-reviews, blink-reviews, haraken
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Encode frame number in pixel data for pose sync This encodes the pose number of the drawn WebVR frame in a corner pixel block, this is read by vr_shell.cc to use the corresponding pose when submitting the frame to GVR for presentation. Log data shows that the pose is 2-3 frames old by the time it is ready for submission to GVR. This includes compositor buffering and SurfaceTexture buffering. The patch helps in getting reprojection working as intended, but can't do anything about the excessive latency. BUG=389343 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel Committed: https://crrev.com/dfa8ed4b3b10200b70d9f79cf247b8a1ec23e20e Cr-Commit-Position: refs/heads/master@{#423367}

Patch Set 1 #

Patch Set 2 : Frame pose sync: fix oscillating off-by-one #

Total comments: 19

Patch Set 3 : bajones #4: use contextGL(), auto-restore state, add poseNum to VRPosePtr #

Total comments: 9

Patch Set 4 : bajones #10: restoreStateFromContext, skip pixel read for non-async mode #

Total comments: 32

Patch Set 5 : mthiesse #17: pose_index, ctx->restore*() methods #

Patch Set 6 : dcheng #19/20, mthiesse #17: use vector + init pose ring buffer, cleanups #

Total comments: 12

Patch Set 7 : dcheng #22, mthiesse #31: rebase, simpler ring buffer initialization, fix type #

Total comments: 4

Patch Set 8 : bajones #40: add sanity check + pointer zeroing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+193 lines, -9 lines) Patch
M chrome/browser/android/vr_shell/vr_shell.h View 1 2 3 4 5 6 7 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_shell.cc View 1 2 3 4 5 6 7 3 chunks +33 lines, -0 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_shell_renderer.cc View 1 2 1 chunk +9 lines, -1 line 0 comments Download
M device/vr/android/gvr/gvr_delegate.h View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M device/vr/android/gvr/gvr_device.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M device/vr/android/gvr/gvr_device.cc View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M device/vr/android/gvr/gvr_device_provider.cc View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M device/vr/vr_service.mojom View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/vr/DEPS View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/vr/VRDisplay.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/vr/VRDisplay.cpp View 1 2 3 4 5 6 7 5 chunks +41 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h View 1 2 3 4 5 6 2 chunks +13 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp View 1 2 3 4 5 6 3 chunks +72 lines, -7 lines 0 comments Download

Messages

Total messages: 59 (19 generated)
klausw
On 2016/09/30 23:06:10, klausw wrote: > mailto:klausw@chromium.org changed reviewers: > + mailto:bajones@chromium.org, mailto:bshe@chromium.org Mailing for ...
4 years, 2 months ago (2016-09-30 23:08:53 UTC) #3
bajones
Looking pretty good, though the glReadPixels makes the graphics dev in me cry. A few ...
4 years, 2 months ago (2016-10-02 20:55:23 UTC) #4
klausw
> Looking pretty good, though the glReadPixels makes the graphics dev in me cry. Yes, ...
4 years, 2 months ago (2016-10-02 21:25:50 UTC) #5
klausw
On 2016/10/02 21:25:50, klausw wrote: > > Looking pretty good, though the glReadPixels makes the ...
4 years, 2 months ago (2016-10-02 21:27:57 UTC) #6
klausw
https://codereview.chromium.org/2384593002/diff/20001/third_party/WebKit/Source/modules/vr/VRDisplay.cpp File third_party/WebKit/Source/modules/vr/VRDisplay.cpp (right): https://codereview.chromium.org/2384593002/diff/20001/third_party/WebKit/Source/modules/vr/VRDisplay.cpp#newcode375 third_party/WebKit/Source/modules/vr/VRDisplay.cpp:375: ctx->disable(GL_SCISSOR_TEST); On 2016/10/02 21:25:50, klausw wrote: > On 2016/10/02 ...
4 years, 2 months ago (2016-10-03 16:50:17 UTC) #7
klausw
PTAL, I think I've addressed your comments. It'll now need security review for the mojom ...
4 years, 2 months ago (2016-10-04 00:40:41 UTC) #9
bajones
Definitely better, though it seems like there's some unwanted changes mixed in here. A few ...
4 years, 2 months ago (2016-10-04 06:33:57 UTC) #10
klausw
Replies below, not changed in code yet. I'll upload an updated version tomorrow. https://codereview.chromium.org/2384593002/diff/40001/chrome/browser/android/vr_shell/vr_controller.h File ...
4 years, 2 months ago (2016-10-04 06:47:04 UTC) #11
klausw
PTAL https://codereview.chromium.org/2384593002/diff/40001/chrome/browser/android/vr_shell/vr_controller.h File chrome/browser/android/vr_shell/vr_controller.h (right): https://codereview.chromium.org/2384593002/diff/40001/chrome/browser/android/vr_shell/vr_controller.h#newcode10 chrome/browser/android/vr_shell/vr_controller.h:10: #include "third_party/gvr-android-sdk/src/ndk/include/vr/gvr/capi/include/gvr.h" On 2016/10/04 06:47:04, klausw wrote: > ...
4 years, 2 months ago (2016-10-04 17:52:47 UTC) #12
klausw
+dcheng for the mojom change, the pose number is needed to match frame image data ...
4 years, 2 months ago (2016-10-04 17:55:01 UTC) #15
mthiesse
https://codereview.chromium.org/2384593002/diff/60001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2384593002/diff/60001/chrome/browser/android/vr_shell/vr_shell.cc#newcode294 chrome/browser/android/vr_shell/vr_shell.cc:294: return pixels[0] | (pixels[1] << 8) | (pixels[2] << ...
4 years, 2 months ago (2016-10-04 21:19:17 UTC) #17
klausw
https://codereview.chromium.org/2384593002/diff/60001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2384593002/diff/60001/chrome/browser/android/vr_shell/vr_shell.cc#newcode294 chrome/browser/android/vr_shell/vr_shell.cc:294: return pixels[0] | (pixels[1] << 8) | (pixels[2] << ...
4 years, 2 months ago (2016-10-04 23:08:14 UTC) #18
dcheng
https://codereview.chromium.org/2384593002/diff/60001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2384593002/diff/60001/chrome/browser/android/vr_shell/vr_shell.cc#newcode279 chrome/browser/android/vr_shell/vr_shell.cc:279: void VrShell::SetGvrPoseForWebVr(gvr::Mat4f pose, uint32_t pose_num) { Nit: pass |pose| ...
4 years, 2 months ago (2016-10-04 23:17:53 UTC) #19
dcheng
https://codereview.chromium.org/2384593002/diff/60001/device/vr/android/gvr/gvr_device_provider.cc File device/vr/android/gvr/gvr_device_provider.cc (right): https://codereview.chromium.org/2384593002/diff/60001/device/vr/android/gvr/gvr_device_provider.cc#newcode68 device/vr/android/gvr/gvr_device_provider.cc:68: void SetGvrPoseForWebVr(gvr::Mat4f pose, uint32_t frameNumStarted) override{}; On 2016/10/04 23:08:14, ...
4 years, 2 months ago (2016-10-04 23:19:06 UTC) #20
klausw
See patchset 6 for changes. mthiesse@, this also includes some updates for your requests which ...
4 years, 2 months ago (2016-10-04 23:56:42 UTC) #21
dcheng
mojo LGTM with nits https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc#newcode160 chrome/browser/android/vr_shell/vr_shell.cc:160: webvr_head_pose_.resize(kPoseRingBufferSize); resize() takes a second ...
4 years, 2 months ago (2016-10-05 07:34:44 UTC) #22
mthiesse
https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc#newcode301 chrome/browser/android/vr_shell/vr_shell.cc:301: glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixels); After you ...
4 years, 2 months ago (2016-10-05 13:14:06 UTC) #23
chromium-reviews
On Oct 5, 2016 06:14, <mthiesse@chromium.org> wrote: > > > https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc > File chrome/browser/android/vr_shell/vr_shell.cc (right): ...
4 years, 2 months ago (2016-10-05 14:11:53 UTC) #24
blink-reviews
On Oct 5, 2016 06:14, <mthiesse@chromium.org> wrote: > > > https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc > File chrome/browser/android/vr_shell/vr_shell.cc (right): ...
4 years, 2 months ago (2016-10-05 14:12:10 UTC) #25
blink-reviews
On Oct 5, 2016 07:11, "Klaus Weidner" <klausw@google.com> wrote: > > On Oct 5, 2016 ...
4 years, 2 months ago (2016-10-05 14:40:02 UTC) #26
chromium-reviews
On Oct 5, 2016 07:11, "Klaus Weidner" <klausw@google.com> wrote: > > On Oct 5, 2016 ...
4 years, 2 months ago (2016-10-05 14:40:03 UTC) #27
blink-reviews
On Oct 5, 2016 07:40, "Klaus Weidner" <klausw@google.com> wrote: > > On Oct 5, 2016 ...
4 years, 2 months ago (2016-10-05 14:51:45 UTC) #28
chromium-reviews
On Oct 5, 2016 07:40, "Klaus Weidner" <klausw@google.com> wrote: > > On Oct 5, 2016 ...
4 years, 2 months ago (2016-10-05 14:51:45 UTC) #29
mthiesse
https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc#newcode301 chrome/browser/android/vr_shell/vr_shell.cc:301: glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixels); On 2016/10/05 ...
4 years, 2 months ago (2016-10-05 14:58:42 UTC) #30
mthiesse
https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc#newcode161 chrome/browser/android/vr_shell/vr_shell.cc:161: const gvr::Mat4f identity = {{{1.0f, 0.0f, 0.0f, 0.0f}, Might ...
4 years, 2 months ago (2016-10-05 15:40:01 UTC) #31
klausw
PTAL at patchset 7. I've rebased to ToT which now includes GVR 1.0.0. https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc File ...
4 years, 2 months ago (2016-10-05 17:02:11 UTC) #32
mthiesse
lgtm
4 years, 2 months ago (2016-10-05 17:06:24 UTC) #33
dcheng
https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2384593002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc#newcode161 chrome/browser/android/vr_shell/vr_shell.cc:161: const gvr::Mat4f identity = {{{1.0f, 0.0f, 0.0f, 0.0f}, On ...
4 years, 2 months ago (2016-10-05 17:35:21 UTC) #37
bajones
LGTM once you've addressed a couple more comments. https://codereview.chromium.org/2384593002/diff/120001/third_party/WebKit/Source/modules/vr/VRDisplay.cpp File third_party/WebKit/Source/modules/vr/VRDisplay.cpp (right): https://codereview.chromium.org/2384593002/diff/120001/third_party/WebKit/Source/modules/vr/VRDisplay.cpp#newcode212 third_party/WebKit/Source/modules/vr/VRDisplay.cpp:212: Let's ...
4 years, 2 months ago (2016-10-05 20:49:05 UTC) #40
klausw
https://codereview.chromium.org/2384593002/diff/120001/third_party/WebKit/Source/modules/vr/VRDisplay.cpp File third_party/WebKit/Source/modules/vr/VRDisplay.cpp (right): https://codereview.chromium.org/2384593002/diff/120001/third_party/WebKit/Source/modules/vr/VRDisplay.cpp#newcode212 third_party/WebKit/Source/modules/vr/VRDisplay.cpp:212: On 2016/10/05 20:49:05, bajones (OOO-Paternity leave) wrote: > Let's ...
4 years, 2 months ago (2016-10-05 21:00:24 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2384593002/140001
4 years, 2 months ago (2016-10-05 21:19:16 UTC) #44
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/292712)
4 years, 2 months ago (2016-10-05 22:35:29 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2384593002/140001
4 years, 2 months ago (2016-10-05 23:15:58 UTC) #48
commit-bot: I haz the power
Try jobs failed on following builders: win_optional_gpu_tests_rel on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_optional_gpu_tests_rel/builds/4296)
4 years, 2 months ago (2016-10-06 00:13:16 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2384593002/140001
4 years, 2 months ago (2016-10-06 00:17:04 UTC) #52
mthiesse
dcheng, please review mojom changes.
4 years, 2 months ago (2016-10-06 00:18:47 UTC) #53
mthiesse
Whoops, disregard that, didn't see the mojo LGTM, and my extension lies :P
4 years, 2 months ago (2016-10-06 00:20:22 UTC) #54
klausw
On 2016/10/06 00:18:47, mthiesse wrote: > dcheng, please review mojom changes. mthiesse@, dcheng already LGTMed ...
4 years, 2 months ago (2016-10-06 00:21:21 UTC) #55
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 2 months ago (2016-10-06 01:04:31 UTC) #57
commit-bot: I haz the power
4 years, 2 months ago (2016-10-06 01:08:11 UTC) #59
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/dfa8ed4b3b10200b70d9f79cf247b8a1ec23e20e
Cr-Commit-Position: refs/heads/master@{#423367}

Powered by Google App Engine
This is Rietveld 408576698