From 2b5ed86a62d43cc91236ebe1c8bcfa9e88327aff Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 15 Sep 2016 01:21:41 -0700 Subject: [PATCH] Fixing warnings --- .../gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp | 14 +++++--------- tests/render-texture-load/src/main.cpp | 3 ++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp b/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp index 5dd356349d..9a9185cd7c 100644 --- a/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp +++ b/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp @@ -204,7 +204,6 @@ GL45Texture::~GL45Texture() { } } - auto originalAllocatedPages = _allocatedPages; auto maxSparseMip = std::min(_maxMip, _sparseInfo._maxSparseLevel); uint8_t maxFace = (uint8_t)((_target == GL_TEXTURE_CUBE_MAP) ? GLTexture::CUBE_NUM_FACES : 1); for (uint16_t mipLevel = _minMip; mipLevel <= maxSparseMip; ++mipLevel) { @@ -216,10 +215,9 @@ GL45Texture::~GL45Texture() { _allocatedPages -= deallocatedPages; } } + if (0 != _allocatedPages) { - auto maxSize = _gpuObject.evalMipDimensions(0); - qDebug() << "Allocated pages remaining " << _id << " " << _allocatedPages; - qDebug() << originalAllocatedPages; + qWarning() << "Allocated pages remaining " << _id << " " << _allocatedPages; } } } @@ -424,7 +422,6 @@ void GL45Texture::updateMips() { if (!_sparse) { return; } - bool modified = false; auto newMinMip = std::min(_gpuObject.minMip(), _sparseInfo._maxSparseLevel); if (_minMip < newMinMip) { stripToMip(newMinMip); @@ -443,8 +440,6 @@ void GL45Backend::derezTextures() const { if (GLTexture::getMemoryPressure() < 1.0f) { return; } - qDebug() << "Allowed texture memory " << Texture::getAllowedGPUMemoryUsage(); - qDebug() << "Used texture memory " << Context::getTextureGPUMemoryUsage(); Lock lock(texturesByMipCountsMutex); if (texturesByMipCounts.empty()) { @@ -458,9 +453,10 @@ void GL45Backend::derezTextures() const { return; } + qDebug() << "Allowed texture memory " << Texture::getAllowedGPUMemoryUsage(); + qDebug() << "Used texture memory " << Context::getTextureGPUMemoryUsage(); + auto& textureMap = texturesByMipCounts; - auto newMipLevel = mipLevel - 1; - qDebug() << "Derez a texture"; GL45Texture* targetTexture = nullptr; { auto& textures = texturesByMipCounts[mipLevel]; diff --git a/tests/render-texture-load/src/main.cpp b/tests/render-texture-load/src/main.cpp index ca0416baeb..fb0b16d16c 100644 --- a/tests/render-texture-load/src/main.cpp +++ b/tests/render-texture-load/src/main.cpp @@ -475,7 +475,7 @@ protected: } void loadAll() { - for (auto i = 0; i < _texturesFiles.size(); ++i) { + for (size_t i = 0; i < _texturesFiles.size(); ++i) { if (_textures[i]) { continue; } @@ -534,6 +534,7 @@ private: auto now = usecTimestampNow(); static auto last = now; auto delta = (now - last) / USECS_PER_MSEC; + Q_UNUSED(delta); #if 0 if (!_textures.empty()) { const auto& front = _textureLoads.front();