-
Notifications
You must be signed in to change notification settings - Fork 218
Conversation
13aa385
to
096dc2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish the WebVR external wasn't so fragile. It seems like small changes in gfxExternalVR will break this. I guess we just need to add some tests at some point. 🙂
app/src/main/cpp/ExternalVR.cpp
Outdated
// Otherwise the shmem data may be deallocated before Gecko processes it, leading to undefined behaviour | ||
Wait wait(m.data.browserMutex, m.data.browserCond); | ||
wait.Lock(); | ||
m.PullBrowserStateWhileLocked(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got me thinking about how to deal with the PullBrowserStateWhileLocked() issue. I wonder if we could use a closure to fix this issue where the code would look something like:
void PullBrowserState(std::function<bool(const BrowserState&)>& aFunc, float aWait = 0.0f) {
wait.lock();
copy_data();
while(!aFunc(m.browserState)) {
if (!wait.DoWait(aWait)) {
break;
}
copy_data()
}
}
I applied the GV patch and pulled this and built and I don't think it is working. STR on the Go:
Expected: FxR launches with https://tonite.dance as the currently loaded page not in immersive mode. But the user is able to enter immersive mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my testing the external struct is not getting removed from Gecko.
I'm seeing this in the log: |
096dc2e
to
133fdf7
Compare
I changed the approach to use the static struct we talked about in slack. Even with that sometimes the next relaunch was a black screen. I found that sometimes there is a deadlock in It seems that there is a race condition where the immersive mode is not paused before This problem could happen with the previous killProcess too. |
@MortimerGoro I assume this no longer requires the Gecko patch? |
@bluemarvin yes, the GV patch is no longer required. I just set the shutdown flag for correctness. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fix-up where ExternVR is creating the shared_ptr<> in Create. Otherwise, looks good.
app/src/main/cpp/ExternalVR.cpp
Outdated
@@ -179,6 +190,8 @@ struct ExternalVR::State { | |||
} | |||
}; | |||
|
|||
ExternalVR::State * ExternalVR::State::sState = nullptr; | |||
|
|||
ExternalVRPtr | |||
ExternalVR::Create() { | |||
return std::make_shared<vrb::ConcreteClass<ExternalVR, ExternalVR::State> >(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the state is no longer instanced with the class this should be:
return std::make_shared<ExternalVR>();
And #include "vrb/ConcreteClass.h"
can be removed.
I'm seeing a dead lock when restarting:
Expected: Should be able to do this indefinitely |
133fdf7
to
a99e080
Compare
I removed the shutdown flag, it was causing some intermittent EnterVR problem after a restart. I can't reproduce the deadlock when restarting (trying with the Go). The only thing I saw is sometimes there is a whole app restart because of #586. It's not easy to reproduce, it seems easier following the STR steps with https://webvr.info/samples/03-vr-presentation.html |
Can no longer reproduce hang issue. |
Fixes #538
Related Gecko PR: https://phabricator.services.mozilla.com/D6236