FIxing the mini mirror perf issue and the gamma correction

This commit is contained in:
samcake 2016-07-14 10:53:13 -07:00
parent b9a2b2778e
commit a42f9a5d0e
5 changed files with 32 additions and 6 deletions

View file

@ -578,8 +578,6 @@ void OpenGLDisplayPlugin::present() {
PROFILE_RANGE_EX(__FUNCTION__, 0xff00ff00, (uint64_t)presentCount()) PROFILE_RANGE_EX(__FUNCTION__, 0xff00ff00, (uint64_t)presentCount())
glEnable(GL_FRAMEBUFFER_SRGB);
updateTextures(); updateTextures();
if (_currentSceneTexture) { if (_currentSceneTexture) {
// Write all layers to a local framebuffer // Write all layers to a local framebuffer

View file

@ -75,7 +75,7 @@ bool StereoDisplayPlugin::internalActivate() {
_container->removeMenu(FRAMERATE); _container->removeMenu(FRAMERATE);
_screen = qApp->primaryScreen(); _screen = qApp->primaryScreen();
// _container->setFullscreen(_screen); _container->setFullscreen(_screen);
return Parent::internalActivate(); return Parent::internalActivate();
} }

View file

@ -201,10 +201,22 @@ void RenderDeferredTask::run(const SceneContextPointer& sceneContext, const Rend
if (!(renderContext->args && renderContext->args->hasViewFrustum())) { if (!(renderContext->args && renderContext->args->hasViewFrustum())) {
return; return;
} }
RenderArgs* args = renderContext->args;
auto config = std::static_pointer_cast<Config>(renderContext->jobConfig);
gpu::doInBatch(args->_context, [&](gpu::Batch& batch) {
_gpuTimer.begin(batch);
});
for (auto job : _jobs) { for (auto job : _jobs) {
job.run(sceneContext, renderContext); job.run(sceneContext, renderContext);
} }
gpu::doInBatch(args->_context, [&](gpu::Batch& batch) {
_gpuTimer.end(batch);
});
config->gpuTime = _gpuTimer.getAverage();
} }
void DrawDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& inputs) { void DrawDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& inputs) {
@ -416,7 +428,7 @@ void DrawBackgroundDeferred::run(const SceneContextPointer& sceneContext, const
}); });
args->_batch = nullptr; args->_batch = nullptr;
std::static_pointer_cast<Config>(renderContext->jobConfig)->gpuTime = _gpuTimer.getAverage(); // std::static_pointer_cast<Config>(renderContext->jobConfig)->gpuTime = _gpuTimer.getAverage();
} }
void Blit::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const gpu::FramebufferPointer& srcFramebuffer) { void Blit::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const gpu::FramebufferPointer& srcFramebuffer) {

View file

@ -173,13 +173,29 @@ public:
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const gpu::FramebufferPointer& srcFramebuffer); void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const gpu::FramebufferPointer& srcFramebuffer);
}; };
class RenderDeferredTaskConfig : public render::Task::Config {
Q_OBJECT
Q_PROPERTY(double gpuTime READ getGpuTime)
public:
double getGpuTime() { return gpuTime; }
protected:
friend class RenderDeferredTask;
double gpuTime;
};
class RenderDeferredTask : public render::Task { class RenderDeferredTask : public render::Task {
public: public:
using Config = RenderDeferredTaskConfig;
RenderDeferredTask(render::CullFunctor cullFunctor); RenderDeferredTask(render::CullFunctor cullFunctor);
void configure(const Config& config) {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext); void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext);
using JobModel = Model<RenderDeferredTask>; using JobModel = Model<RenderDeferredTask, Config>;
protected:
gpu::RangeTimer _gpuTimer;
}; };
#endif // hifi_RenderDeferredTask_h #endif // hifi_RenderDeferredTask_h

View file

@ -521,7 +521,7 @@ public:
template <class... A> template <class... A>
Model(const Varying& input, A&&... args) : Model(const Varying& input, A&&... args) :
Concept(nullptr), _data(Data(std::forward<A>(args)...)), _input(input), _output(Output()) { Concept(std::make_shared<C>()), _data(Data(std::forward<A>(args)...)), _input(input), _output(Output()) {
_config = _data._config; _config = _data._config;
std::static_pointer_cast<Config>(_config)->init(&_data); std::static_pointer_cast<Config>(_config)->init(&_data);
applyConfiguration(); applyConfiguration();