From 1bd95ee19fdb79a28e34f6a3ca3815df45e68e6b Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 26 Apr 2017 14:26:09 -0700 Subject: [PATCH] Remove didQueueTransfer check from populateTransferQueue --- .../gpu-gl/src/gpu/gl41/GL41BackendTexture.cpp | 13 ++++--------- .../src/gpu/gl45/GL45BackendVariableTexture.cpp | 13 ++++--------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/libraries/gpu-gl/src/gpu/gl41/GL41BackendTexture.cpp b/libraries/gpu-gl/src/gpu/gl41/GL41BackendTexture.cpp index 14c7148b3b..948381f288 100644 --- a/libraries/gpu-gl/src/gpu/gl41/GL41BackendTexture.cpp +++ b/libraries/gpu-gl/src/gpu/gl41/GL41BackendTexture.cpp @@ -416,7 +416,6 @@ void GL41VariableAllocationTexture::populateTransferQueue() { --sourceMip; auto targetMip = sourceMip - _allocatedMip; auto mipDimensions = _gpuObject.evalMipDimensions(sourceMip); - bool didQueueTransfer = false; for (uint8_t face = 0; face < maxFace; ++face) { if (!_gpuObject.isStoredMipFaceAvailable(sourceMip, face)) { continue; @@ -426,7 +425,6 @@ void GL41VariableAllocationTexture::populateTransferQueue() { if (glm::all(glm::lessThanEqual(mipDimensions, MAX_TRANSFER_DIMENSIONS))) { // Can the mip be transferred in one go _pendingTransfers.emplace(new TransferJob(*this, sourceMip, targetMip, face)); - didQueueTransfer = true; continue; } @@ -442,17 +440,14 @@ void GL41VariableAllocationTexture::populateTransferQueue() { uint32_t linesToCopy = std::min(lines - lineOffset, linesPerTransfer); _pendingTransfers.emplace(new TransferJob(*this, sourceMip, targetMip, face, linesToCopy, lineOffset)); lineOffset += linesToCopy; - didQueueTransfer = true; } } // queue up the sampler and populated mip change for after the transfer has completed - if (didQueueTransfer) { - _pendingTransfers.emplace(new TransferJob(*this, [=] { - _populatedMip = sourceMip; - syncSampler(); - })); - } + _pendingTransfers.emplace(new TransferJob(*this, [=] { + _populatedMip = sourceMip; + syncSampler(); + })); } while (sourceMip != _allocatedMip); } diff --git a/libraries/gpu-gl/src/gpu/gl45/GL45BackendVariableTexture.cpp b/libraries/gpu-gl/src/gpu/gl45/GL45BackendVariableTexture.cpp index c25d011073..6e00159a2e 100644 --- a/libraries/gpu-gl/src/gpu/gl45/GL45BackendVariableTexture.cpp +++ b/libraries/gpu-gl/src/gpu/gl45/GL45BackendVariableTexture.cpp @@ -186,7 +186,6 @@ void GL45ResourceTexture::populateTransferQueue() { --sourceMip; auto targetMip = sourceMip - _allocatedMip; auto mipDimensions = _gpuObject.evalMipDimensions(sourceMip); - bool didQueueTransfer = false; for (uint8_t face = 0; face < maxFace; ++face) { if (!_gpuObject.isStoredMipFaceAvailable(sourceMip, face)) { continue; @@ -196,7 +195,6 @@ void GL45ResourceTexture::populateTransferQueue() { if (glm::all(glm::lessThanEqual(mipDimensions, MAX_TRANSFER_DIMENSIONS))) { // Can the mip be transferred in one go _pendingTransfers.emplace(new TransferJob(*this, sourceMip, targetMip, face)); - didQueueTransfer = true; continue; } @@ -212,17 +210,14 @@ void GL45ResourceTexture::populateTransferQueue() { uint32_t linesToCopy = std::min(lines - lineOffset, linesPerTransfer); _pendingTransfers.emplace(new TransferJob(*this, sourceMip, targetMip, face, linesToCopy, lineOffset)); lineOffset += linesToCopy; - didQueueTransfer = true; } } // queue up the sampler and populated mip change for after the transfer has completed - if (didQueueTransfer) { - _pendingTransfers.emplace(new TransferJob(*this, [=] { - _populatedMip = sourceMip; - syncSampler(); - })); - } + _pendingTransfers.emplace(new TransferJob(*this, [=] { + _populatedMip = sourceMip; + syncSampler(); + })); } while (sourceMip != _allocatedMip); }