Fix initial state of view correction, plus overkill

This commit is contained in:
Brad Davis 2016-08-04 13:44:16 -07:00
parent cbe1f6dbf5
commit 0396694715
3 changed files with 13 additions and 1 deletions

View file

@ -105,6 +105,12 @@ public:
virtual void run() override {
// FIXME determine the best priority balance between this and the main thread...
// It may be dependent on the display plugin being used, since VR plugins should
// have higher priority on rendering (although we could say that the Oculus plugin
// doesn't need that since it has async timewarp).
// A higher priority here
setPriority(QThread::HighPriority);
OpenGLDisplayPlugin* currentPlugin{ nullptr };
Q_ASSERT(_context);
while (!_shutdown) {
@ -302,6 +308,8 @@ void OpenGLDisplayPlugin::customizeContext() {
Q_ASSERT(thread() == presentThread->thread());
enableVsync();
getGLBackend()->setCameraCorrection(mat4());
for (auto& cursorValue : _cursorsData) {
auto& cursorData = cursorValue.second;
if (!cursorData.texture) {

View file

@ -118,7 +118,6 @@ void HmdDisplayPlugin::customizeContext() {
void HmdDisplayPlugin::uncustomizeContext() {
_overlayRenderer = OverlayRenderer();
getGLBackend()->setCameraCorrection(mat4());
Parent::uncustomizeContext();
}

View file

@ -338,6 +338,11 @@ protected:
GLState* _state { nullptr };
bool _invalidState { false };
PipelineStageState() {
_cameraCorrectionBuffer.edit<CameraCorrection>() = CameraCorrection();
_cameraCorrectionBuffer._buffer->flush();
}
} _pipeline;
// Synchronize the state cache of this Backend with the actual real state of the GL Context