From 74481b3c1fefe940da669ce56d66651d400263a5 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 15 Sep 2016 15:45:47 -0700 Subject: [PATCH] Re-enable threaded texture transfer --- libraries/gpu-gl/src/gpu/gl/GLTexture.cpp | 16 +++++++++------- libraries/gpu-gl/src/gpu/gl/GLTextureTransfer.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libraries/gpu-gl/src/gpu/gl/GLTexture.cpp b/libraries/gpu-gl/src/gpu/gl/GLTexture.cpp index 3a45f55646..4796d0497e 100644 --- a/libraries/gpu-gl/src/gpu/gl/GLTexture.cpp +++ b/libraries/gpu-gl/src/gpu/gl/GLTexture.cpp @@ -108,13 +108,15 @@ float GLTexture::getMemoryPressure() { } else { // Check the global free GPU memory auto freeGpuMemory = getFreeDedicatedMemory(); - static gpu::Size lastFreeGpuMemory = 0; - auto freePercentage = (float)freeGpuMemory / (float)totalGpuMemory; - if (freeGpuMemory != lastFreeGpuMemory) { - lastFreeGpuMemory = freeGpuMemory; - if (freePercentage < MIN_FREE_GPU_MEMORY_PERCENTAGE) { - qDebug() << "Exceeded max GPU memory"; - return 2.0; + if (freeGpuMemory) { + static gpu::Size lastFreeGpuMemory = 0; + auto freePercentage = (float)freeGpuMemory / (float)totalGpuMemory; + if (freeGpuMemory != lastFreeGpuMemory) { + lastFreeGpuMemory = freeGpuMemory; + if (freePercentage < MIN_FREE_GPU_MEMORY_PERCENTAGE) { + qDebug() << "Exceeded max GPU memory"; + return 2.0; + } } } } diff --git a/libraries/gpu-gl/src/gpu/gl/GLTextureTransfer.h b/libraries/gpu-gl/src/gpu/gl/GLTextureTransfer.h index a880f42394..fe7414e370 100644 --- a/libraries/gpu-gl/src/gpu/gl/GLTextureTransfer.h +++ b/libraries/gpu-gl/src/gpu/gl/GLTextureTransfer.h @@ -18,7 +18,7 @@ #include "GLShared.h" #ifdef Q_OS_WIN -//#define THREADED_TEXTURE_TRANSFER +#define THREADED_TEXTURE_TRANSFER #endif namespace gpu { namespace gl {