From b42170c7b651695f9d4fecf67a5707010c07b006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gro=C3=9F?= Date: Sun, 10 Oct 2021 15:01:35 +0200 Subject: [PATCH 1/4] Disable automatic texture memory on unsupported platforms. Fix automatic texture memory fallback. --- .../gpu-gl-common/src/gpu/gl/GLBackend.cpp | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp index dd30727523..b907021399 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp +++ b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp @@ -151,13 +151,21 @@ void GLBackend::init() { GPUIdent* gpu = GPUIdent::getInstance(vendor, renderer); unsigned int mem; +// Do not try to get texture memory information on unsupported systems. +#if defined(Q_OS_ANDROID) || defined(USE_GLES) || defined(Q_OS_DARWIN) + qCDebug(gpugllogging) << "Automatic texture memory not supported in this configuration"; + _videoCard = Unknown; + _dedicatedMemory = gpu->getMemory() * BYTES_PER_MIB; + _totalMemory = _dedicatedMemory; +#endif + +#if !defined(Q_OS_ANDROID) && !defined(USE_GLES) && !defined(Q_OS_DARWIN) if (vendor.contains("NVIDIA") ) { qCDebug(gpugllogging) << "NVIDIA card detected"; -#if !defined(Q_OS_ANDROID) && !defined(USE_GLES) + GL_GET_INTEGER(GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX); GL_GET_INTEGER(GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX); GL_GET_INTEGER(GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX); -#endif qCDebug(gpugllogging) << "GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX: " << GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX; qCDebug(gpugllogging) << "GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX: " << GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX; @@ -170,10 +178,10 @@ void GLBackend::init() { } else if (vendor.contains("ATI")) { qCDebug(gpugllogging) << "ATI card detected"; -#if !defined(Q_OS_ANDROID) && !defined(USE_GLES) - GL_GET_INTEGER(TEXTURE_FREE_MEMORY_ATI); -#endif + GL_GET_INTEGER(TEXTURE_FREE_MEMORY_ATI); + + // We are actually getting free memory instead of total memory _totalMemory = TEXTURE_FREE_MEMORY_ATI * BYTES_PER_KIB; _dedicatedMemory = _totalMemory; _videoCard = ATI; @@ -187,9 +195,10 @@ void GLBackend::init() { } else { qCCritical(gpugllogging) << "Don't know how to get memory for OpenGL vendor " << vendor << "; renderer " << renderer << ", trying fallback"; _videoCard = Unknown; - _dedicatedMemory = gpu->getMemory(); + _dedicatedMemory = gpu->getMemory() * BYTES_PER_MIB; _totalMemory = _dedicatedMemory; } +#endif qCDebug(gpugllogging) << "dedicated: " << _dedicatedMemory; qCDebug(gpugllogging) << "total: " << _totalMemory; From e5609e10c2cadd89a9f127dc3731ea63cd111c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gro=C3=9F?= Date: Tue, 12 Oct 2021 00:20:43 +0200 Subject: [PATCH 2/4] Do not search for crashpad inside Interface binary. --- interface/src/CrashHandler_Crashpad.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/src/CrashHandler_Crashpad.cpp b/interface/src/CrashHandler_Crashpad.cpp index 8c8ceed4b3..50f384b0d6 100644 --- a/interface/src/CrashHandler_Crashpad.cpp +++ b/interface/src/CrashHandler_Crashpad.cpp @@ -386,6 +386,8 @@ bool startCrashHandler(std::string appPath) { } else { qCDebug(crash_handler) << "Locating own directory by argv[0]"; interfaceDir.setPath(QString::fromStdString(appPath)); + // argv[0] gets us the path including the binary file + interfaceDir.cdUp(); } if (!interfaceDir.exists(CRASHPAD_HANDLER_NAME)) { From ed725fd814792e3dcaab353b6ebcc0856883fd01 Mon Sep 17 00:00:00 2001 From: Penguin-Guru Date: Sun, 24 Oct 2021 10:40:58 -0700 Subject: [PATCH 3/4] Fixed typo. --- interface/src/PerformanceManager.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/interface/src/PerformanceManager.cpp b/interface/src/PerformanceManager.cpp index 47e4f0612b..1ff2319b1b 100644 --- a/interface/src/PerformanceManager.cpp +++ b/interface/src/PerformanceManager.cpp @@ -69,15 +69,15 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP bool isDeferredCapable = platform::Profiler::isRenderMethodDeferredCapable(); auto masterDisplay = platform::getDisplay(platform::getMasterDisplay()); - // eval recommanded PPI and Scale - float recommandedPpiScale = 1.0f; - const float RECOMMANDED_PPI[] = { 200.0f, 120.f, 160.f, 250.f}; + // eval recommended PPI and Scale + float recommendedPpiScale = 1.0f; + const float RECOMMENDED_PPI[] = { 200.0f, 120.f, 160.f, 250.f}; if (!masterDisplay.empty() && masterDisplay.count(platform::keys::display::ppi)) { float ppi = masterDisplay[platform::keys::display::ppi]; // only scale if the actual ppi is higher than the recommended ppi - if (ppi > RECOMMANDED_PPI[preset]) { + if (ppi > RECOMMENDED_PPI[preset]) { // make sure the scale is no less than a quarter - recommandedPpiScale = std::max(0.25f, RECOMMANDED_PPI[preset] / (float) ppi); + recommendedPpiScale = std::max(0.25f, RECOMMENDED_PPI[preset] / (float) ppi); } } @@ -87,7 +87,7 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP RenderScriptingInterface::RenderMethod::DEFERRED : RenderScriptingInterface::RenderMethod::FORWARD ) ); - RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommandedPpiScale); + RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommendedPpiScale); RenderScriptingInterface::getInstance()->setShadowsEnabled(true); qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME); @@ -100,7 +100,7 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP RenderScriptingInterface::RenderMethod::DEFERRED : RenderScriptingInterface::RenderMethod::FORWARD)); - RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommandedPpiScale); + RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommendedPpiScale); RenderScriptingInterface::getInstance()->setShadowsEnabled(false); qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::INTERACTIVE); @@ -112,7 +112,7 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP RenderScriptingInterface::getInstance()->setShadowsEnabled(false); qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::ECO); - RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommandedPpiScale); + RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommendedPpiScale); DependencyManager::get()->setWorldDetailQuality(WORLD_DETAIL_LOW); From 526f526aa67f8fb6ae5727e64f167f12d51e9411 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sun, 24 Oct 2021 22:32:12 +0200 Subject: [PATCH 4/4] Don't retrieve repository's SHA in prebuild Doing this means source can only be built when checked out from git, and can't be build from an archive. --- prebuild.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/prebuild.py b/prebuild.py index f272b04b23..5483703cb7 100644 --- a/prebuild.py +++ b/prebuild.py @@ -58,22 +58,6 @@ class TrackableLogger(logging.Logger): logging.setLoggerClass(TrackableLogger) logger = logging.getLogger('prebuild') -def headSha(): - if shutil.which('git') is None: - logger.warn("Unable to find git executable, can't caclulate commit ID") - return '0xDEADBEEF' - repo_dir = os.path.dirname(os.path.abspath(__file__)) - git = subprocess.Popen( - 'git rev-parse --short HEAD', - stdout=subprocess.PIPE, stderr=subprocess.PIPE, - shell=True, cwd=repo_dir, universal_newlines=True, - ) - stdout, _ = git.communicate() - sha = stdout.split('\n')[0] - if not sha: - raise RuntimeError("couldn't find git sha for repository {}".format(repo_dir)) - return sha - @contextmanager def timer(name): ''' Print the elapsed time a context's execution takes to execute ''' @@ -120,7 +104,6 @@ def main(): if args.ci_build: logging.basicConfig(datefmt='%H:%M:%S', format='%(asctime)s %(guid)s %(message)s', level=logging.INFO) - logger.info('sha=%s' % headSha()) logger.info('start') # OS dependent information