diff --git a/libraries/gl/src/gl/Config.h b/libraries/gl/src/gl/Config.h index 8defbc5bca..1c80cf4a10 100644 --- a/libraries/gl/src/gl/Config.h +++ b/libraries/gl/src/gl/Config.h @@ -52,7 +52,7 @@ namespace gl { void initModuleGl(); int getSwapInterval(); void setSwapInterval(int swapInterval); - bool queryCurrentRendererIntegerMESA(int attr, unsigned int *value); + bool queryCurrentRendererIntegerMESA(int attr, unsigned int *value); } #endif // hifi_gpu_GPUConfig_h diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp index 63cbf804d1..602ab1c320 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp +++ b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp @@ -160,7 +160,6 @@ void GLBackend::init() { 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; qCDebug(gpugllogging) << "GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX: " << GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX; - qCDebug(gpugllogging) << "sz: " << sizeof(_totalMemory); _totalMemory = GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX * BYTES_PER_KIB; _dedicatedMemory = GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX * BYTES_PER_KIB; @@ -237,10 +236,14 @@ size_t GLBackend::getAvailableMemory() { bool GLBackend::availableMemoryKnown() { switch( _videoCard ) { - case NVIDIA: return true; - case ATI: return true; - case MESA: return false; - case Unknown: return false; + case NVIDIA: + return true; + case ATI: + return true; + case MESA: + return false; + case Unknown: + return false; } return false; diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLTextureTransfer.cpp b/libraries/gpu-gl-common/src/gpu/gl/GLTextureTransfer.cpp index c39dc2917d..6a88fd2c50 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLTextureTransfer.cpp +++ b/libraries/gpu-gl-common/src/gpu/gl/GLTextureTransfer.cpp @@ -191,7 +191,7 @@ void GLTextureTransferEngineDefault::updateMemoryPressure() { if (0 == allowedMemoryAllocation) { // Automatic allocation - if ( GLBackend::availableMemoryKnown() ) { + if (GLBackend::availableMemoryKnown()) { // If we know how much is free, then we use that useAvailableGlMemory = true; } else { @@ -199,7 +199,7 @@ void GLTextureTransferEngineDefault::updateMemoryPressure() { // and hope it works. allowedMemoryAllocation = GLBackend::getTotalMemory() * MAX_AUTO_FRACTION_OF_TOTAL_MEMORY; - if ( 0 == allowedMemoryAllocation ) { + if (0 == allowedMemoryAllocation) { // Last resort, if we failed to detect allowedMemoryAllocation = DEFAULT_ALLOWED_TEXTURE_MEMORY; } @@ -238,14 +238,14 @@ void GLTextureTransferEngineDefault::updateMemoryPressure() { size_t unallocated = idealMemoryAllocation - totalVariableMemoryAllocation; float pressure = 0; - if ( useAvailableGlMemory ) { - float total_mem = GLBackend::getTotalMemory(); - float avail_mem = GLBackend::getAvailableMemory() - AUTO_RESERVE_TEXTURE_MEMORY; - if ( avail_mem < 0 ) { - avail_mem = 0; + if (useAvailableGlMemory) { + float totalMem = GLBackend::getTotalMemory(); + float availMem = GLBackend::getAvailableMemory() - AUTO_RESERVE_TEXTURE_MEMORY; + if (availMem < 0) { + availMem = 0; } - pressure = (total_mem - avail_mem) / total_mem; + pressure = (totalMem - availMem) / totalMem; } else { pressure = (float)totalVariableMemoryAllocation / (float)allowedMemoryAllocation; }