mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 13:42:55 +02:00
Code comments
This commit is contained in:
parent
439cb388f2
commit
066a6483a0
2 changed files with 14 additions and 2 deletions
|
@ -134,10 +134,20 @@ public:
|
||||||
virtual void promote() = 0;
|
virtual void promote() = 0;
|
||||||
virtual void demote() = 0;
|
virtual void demote() = 0;
|
||||||
|
|
||||||
uint16 _populatedMip { 0 };
|
// The allocated mip level, relative to the number of mips in the gpu::Texture object
|
||||||
|
// The relationship between a given glMip to the original gpu::Texture mip is always
|
||||||
|
// glMip + _allocatedMip
|
||||||
uint16 _allocatedMip { 0 };
|
uint16 _allocatedMip { 0 };
|
||||||
|
// The populated mip level, relative to the number of mips in the gpu::Texture object
|
||||||
|
// This must always be >= the allocated mip
|
||||||
|
uint16 _populatedMip { 0 };
|
||||||
|
// The highest (lowest resolution) mip that we will support, relative to the number
|
||||||
|
// of mips in the gpu::Texture object
|
||||||
uint16 _maxAllocatedMip { 0 };
|
uint16 _maxAllocatedMip { 0 };
|
||||||
uint32 _size { 0 };
|
uint32 _size { 0 };
|
||||||
|
// Contains a series of lambdas that when executed will transfer data to the GPU, modify
|
||||||
|
// the _populatedMip and update the sampler in order to fully populate the allocated texture
|
||||||
|
// until _populatedMip == _allocatedMip
|
||||||
std::queue<PromoteLambda> _pendingTransfers;
|
std::queue<PromoteLambda> _pendingTransfers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -154,7 +164,6 @@ public:
|
||||||
|
|
||||||
void allocateStorage(uint16 mip);
|
void allocateStorage(uint16 mip);
|
||||||
void copyMipsFromTexture();
|
void copyMipsFromTexture();
|
||||||
private:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -56,18 +56,21 @@ void GL45VariableAllocationTexture::addToWorkQueue(const TexturePointer& texture
|
||||||
switch (_memoryPressureState) {
|
switch (_memoryPressureState) {
|
||||||
case MemoryPressureState::Oversubscribed:
|
case MemoryPressureState::Oversubscribed:
|
||||||
if (object->canDemote()) {
|
if (object->canDemote()) {
|
||||||
|
// Demote largest first
|
||||||
_demoteQueue.push({ texturePointer, (float)object->size() });
|
_demoteQueue.push({ texturePointer, (float)object->size() });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MemoryPressureState::Undersubscribed:
|
case MemoryPressureState::Undersubscribed:
|
||||||
if (object->canPromote()) {
|
if (object->canPromote()) {
|
||||||
|
// Promote smallest first
|
||||||
_promoteQueue.push({ texturePointer, 1.0f / (float)object->size() });
|
_promoteQueue.push({ texturePointer, 1.0f / (float)object->size() });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MemoryPressureState::Transfer:
|
case MemoryPressureState::Transfer:
|
||||||
if (object->hasPendingTransfers()) {
|
if (object->hasPendingTransfers()) {
|
||||||
|
// Transfer priority given to smaller mips first
|
||||||
_transferQueue.push({ texturePointer, 1.0f / (float)object->_gpuObject.evalMipSize(object->_populatedMip) });
|
_transferQueue.push({ texturePointer, 1.0f / (float)object->_gpuObject.evalMipSize(object->_populatedMip) });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue