getting rid of the resolution Scale on the display plugin

This commit is contained in:
Sam Gateau 2019-06-21 10:36:25 -07:00
parent 69bb9ac0b6
commit a856fdb3ca
4 changed files with 4 additions and 19 deletions

View file

@ -3743,11 +3743,6 @@ void Application::resizeGL() {
DependencyManager::get<FramebufferCache>()->setFrameBufferSize(fromGlm(renderSize)); DependencyManager::get<FramebufferCache>()->setFrameBufferSize(fromGlm(renderSize));
} }
auto renderResolutionScale = getRenderResolutionScale();
if (displayPlugin->getRenderResolutionScale() != renderResolutionScale) {
displayPlugin->setRenderResolutionScale(renderResolutionScale);
}
// FIXME the aspect ratio for stereo displays is incorrect based on this. // FIXME the aspect ratio for stereo displays is incorrect based on this.
float aspectRatio = displayPlugin->getRecommendedAspectRatio(); float aspectRatio = displayPlugin->getRecommendedAspectRatio();
_myCamera.setProjection(glm::perspective(glm::radians(_fieldOfView.get()), aspectRatio, _myCamera.setProjection(glm::perspective(glm::radians(_fieldOfView.get()), aspectRatio,
@ -8541,7 +8536,7 @@ void Application::shareSnapshot(const QString& path, const QUrl& href) {
} }
float Application::getRenderResolutionScale() const { float Application::getRenderResolutionScale() const {
return 1.0f; return RenderScriptingInterface::getInstance()->getViewportResolutionScale();
} }
void Application::notifyPacketVersionMismatch() { void Application::notifyPacketVersionMismatch() {

View file

@ -112,8 +112,8 @@ void setupPreferences() {
RenderScriptingInterface::getInstance()->setViewportResolutionScale(value); RenderScriptingInterface::getInstance()->setViewportResolutionScale(value);
}; };
auto scaleSlider = new SpinnerSliderPreference(GRAPHICS_QUALITY, "Viewport Resolution Scale", getter, setter); auto scaleSlider = new SliderPreference(GRAPHICS_QUALITY, "Viewport Resolution Scale", getter, setter);
scaleSlider->setMin(0.5f); scaleSlider->setMin(0.25f);
scaleSlider->setMax(1.0f); scaleSlider->setMax(1.0f);
scaleSlider->setStep(0.02f); scaleSlider->setStep(0.02f);
preferences->addPreference(scaleSlider); preferences->addPreference(scaleSlider);

View file

@ -377,7 +377,7 @@ void Stats::updateStats(bool force) {
auto displayPlugin = qApp->getActiveDisplayPlugin(); auto displayPlugin = qApp->getActiveDisplayPlugin();
if (displayPlugin) { if (displayPlugin) {
QVector2D dims(displayPlugin->getRecommendedRenderSize().x, displayPlugin->getRecommendedRenderSize().y); QVector2D dims(displayPlugin->getRecommendedRenderSize().x, displayPlugin->getRecommendedRenderSize().y);
dims *= displayPlugin->getRenderResolutionScale(); dims *= qApp->getRenderResolutionScale();
STAT_UPDATE(gpuFrameSize, dims); STAT_UPDATE(gpuFrameSize, dims);
STAT_UPDATE(gpuFrameTimePerPixel, (float)(gpuContext->getFrameTimerGPUAverage()*1000000.0 / double(dims.x()*dims.y()))); STAT_UPDATE(gpuFrameTimePerPixel, (float)(gpuContext->getFrameTimerGPUAverage()*1000000.0 / double(dims.x()*dims.y())));
} }

View file

@ -147,14 +147,6 @@ public:
virtual void submitFrame(const gpu::FramePointer& newFrame) = 0; virtual void submitFrame(const gpu::FramePointer& newFrame) = 0;
virtual void captureFrame(const std::string& outputName) const { } virtual void captureFrame(const std::string& outputName) const { }
virtual float getRenderResolutionScale() const {
return _renderResolutionScale;
}
void setRenderResolutionScale(float renderResolutionScale) {
_renderResolutionScale = renderResolutionScale;
}
// The size of the rendering target (may be larger than the device size due to distortion) // The size of the rendering target (may be larger than the device size due to distortion)
virtual glm::uvec2 getRecommendedRenderSize() const = 0; virtual glm::uvec2 getRecommendedRenderSize() const = 0;
@ -235,8 +227,6 @@ protected:
MovingAverage<float, 10> _movingAveragePresent; MovingAverage<float, 10> _movingAveragePresent;
float _renderResolutionScale { 1.0f };
private: private:
QMutex _presentMutex; QMutex _presentMutex;
QWaitCondition _presentCondition; QWaitCondition _presentCondition;