From fe5c511eeb310f5ef7181a0cf61353f27cff1b59 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 9 Feb 2017 12:09:59 -0800 Subject: [PATCH] Fix texture count --- libraries/gpu-gl/src/gpu/gl45/GL45BackendVariableTexture.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/gpu-gl/src/gpu/gl45/GL45BackendVariableTexture.cpp b/libraries/gpu-gl/src/gpu/gl45/GL45BackendVariableTexture.cpp index a6ab13c258..67ab1b5bb5 100644 --- a/libraries/gpu-gl/src/gpu/gl45/GL45BackendVariableTexture.cpp +++ b/libraries/gpu-gl/src/gpu/gl45/GL45BackendVariableTexture.cpp @@ -385,6 +385,7 @@ void GL45ResourceTexture::promote() { uint32_t oldSize = _size; // create new texture const_cast(_id) = allocate(_gpuObject); + incrementTextureGPUCount(); uint16_t oldAllocatedMip = _allocatedMip; // allocate storage for new level allocateStorage(_allocatedMip - std::min(_allocatedMip, 2)); @@ -418,6 +419,7 @@ void GL45ResourceTexture::demote() { auto oldId = _id; auto oldSize = _size; const_cast(_id) = allocate(_gpuObject); + incrementTextureGPUCount(); allocateStorage(_allocatedMip + 1); _populatedMip = std::max(_populatedMip, _allocatedMip); uint16_t mips = _gpuObject.evalNumMips(); @@ -482,7 +484,7 @@ void GL45ResourceTexture::populateTransferQueue() { const auto lines = mipDimensions.y; auto bytesPerLine = (uint32_t)mipData->getSize() / lines; Q_ASSERT(0 == (mipData->getSize() % lines)); - auto linesPerTransfer = MAX_TRANSFER_SIZE / bytesPerLine; + uint32_t linesPerTransfer = (uint32_t)(MAX_TRANSFER_SIZE / bytesPerLine); size_t offset = 0; uint32_t lineOffset = 0; while (lineOffset < lines) {