Move compositing framebuffer to main GL plugin

This commit is contained in:
Brad Davis 2016-08-01 11:28:08 -07:00
parent 894d29bb29
commit 64ece05f40
4 changed files with 15 additions and 9 deletions

View file

@ -368,11 +368,22 @@ void OpenGLDisplayPlugin::customizeContext() {
_cursorPipeline = gpu::Pipeline::create(program, state);
}
}
auto renderSize = getRecommendedRenderSize();
_compositeFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create(gpu::Element::COLOR_SRGBA_32, renderSize.x, renderSize.y));
_compositeTexture = _compositeFramebuffer->getRenderBuffer(0);
}
void OpenGLDisplayPlugin::uncustomizeContext() {
_presentPipeline.reset();
_cursorPipeline.reset();
_overlayPipeline.reset();
_compositeFramebuffer.reset();
_compositeTexture.reset();
withPresentThreadLock([&] {
_currentFrame.reset();
_newFrameQueue.swap(std::queue<gpu::FramePointer>());
});
}

View file

@ -107,7 +107,10 @@ protected:
RateCounter<> _droppedFrameRate;
RateCounter<> _newFrameRate;
RateCounter<> _presentRate;
gpu::FramePointer _currentFrame;
gpu::FramebufferPointer _compositeFramebuffer;
gpu::TexturePointer _compositeTexture;
gpu::PipelinePointer _overlayPipeline;
gpu::PipelinePointer _presentPipeline;
gpu::PipelinePointer _cursorPipeline;

View file

@ -118,18 +118,12 @@ void HmdDisplayPlugin::customizeContext() {
updateLaserProgram();
_laserGeometry = loadLaser(_laserProgram);
#endif
_compositeFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create(gpu::Element::COLOR_SRGBA_32, _renderTargetSize.x, _renderTargetSize.y));
_compositeTexture = _compositeFramebuffer->getRenderBuffer(0);
}
void HmdDisplayPlugin::uncustomizeContext() {
_overlay = OverlayRenderer();
#if 0
_overlayProgram.reset();
_sphereSection.reset();
_compositeFramebuffer.reset();
_previewProgram.reset();
_reprojectionProgram.reset();
_laserProgram.reset();
_laserGeometry.reset();
#endif

View file

@ -93,8 +93,6 @@ protected:
QMap<uint32_t, FrameInfo> _frameInfos;
FrameInfo _currentPresentFrameInfo;
FrameInfo _currentRenderFrameInfo;
gpu::FramebufferPointer _compositeFramebuffer;
gpu::TexturePointer _compositeTexture;
private:
void updateLaserProgram();