mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:58:27 +02:00
Fix texture count
This commit is contained in:
parent
1238edd0d7
commit
fe5c511eeb
1 changed files with 3 additions and 1 deletions
|
@ -385,6 +385,7 @@ void GL45ResourceTexture::promote() {
|
||||||
uint32_t oldSize = _size;
|
uint32_t oldSize = _size;
|
||||||
// create new texture
|
// create new texture
|
||||||
const_cast<GLuint&>(_id) = allocate(_gpuObject);
|
const_cast<GLuint&>(_id) = allocate(_gpuObject);
|
||||||
|
incrementTextureGPUCount();
|
||||||
uint16_t oldAllocatedMip = _allocatedMip;
|
uint16_t oldAllocatedMip = _allocatedMip;
|
||||||
// allocate storage for new level
|
// allocate storage for new level
|
||||||
allocateStorage(_allocatedMip - std::min<uint16_t>(_allocatedMip, 2));
|
allocateStorage(_allocatedMip - std::min<uint16_t>(_allocatedMip, 2));
|
||||||
|
@ -418,6 +419,7 @@ void GL45ResourceTexture::demote() {
|
||||||
auto oldId = _id;
|
auto oldId = _id;
|
||||||
auto oldSize = _size;
|
auto oldSize = _size;
|
||||||
const_cast<GLuint&>(_id) = allocate(_gpuObject);
|
const_cast<GLuint&>(_id) = allocate(_gpuObject);
|
||||||
|
incrementTextureGPUCount();
|
||||||
allocateStorage(_allocatedMip + 1);
|
allocateStorage(_allocatedMip + 1);
|
||||||
_populatedMip = std::max(_populatedMip, _allocatedMip);
|
_populatedMip = std::max(_populatedMip, _allocatedMip);
|
||||||
uint16_t mips = _gpuObject.evalNumMips();
|
uint16_t mips = _gpuObject.evalNumMips();
|
||||||
|
@ -482,7 +484,7 @@ void GL45ResourceTexture::populateTransferQueue() {
|
||||||
const auto lines = mipDimensions.y;
|
const auto lines = mipDimensions.y;
|
||||||
auto bytesPerLine = (uint32_t)mipData->getSize() / lines;
|
auto bytesPerLine = (uint32_t)mipData->getSize() / lines;
|
||||||
Q_ASSERT(0 == (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;
|
size_t offset = 0;
|
||||||
uint32_t lineOffset = 0;
|
uint32_t lineOffset = 0;
|
||||||
while (lineOffset < lines) {
|
while (lineOffset < lines) {
|
||||||
|
|
Loading…
Reference in a new issue