mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 05:09:23 +02:00
Solving the size evaluation for compressed format
This commit is contained in:
parent
e4f9f2935e
commit
e0487f7e04
4 changed files with 12 additions and 10 deletions
|
@ -270,17 +270,17 @@ Item {
|
||||||
StatText {
|
StatText {
|
||||||
text: "GPU Textures: ";
|
text: "GPU Textures: ";
|
||||||
}
|
}
|
||||||
StatText {
|
|
||||||
text: " Pressure State: " + root.gpuTextureMemoryPressureState;
|
|
||||||
}
|
|
||||||
StatText {
|
StatText {
|
||||||
text: " Count: " + root.gpuTextures;
|
text: " Count: " + root.gpuTextures;
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
text: " Pending Transfer: " + root.texturePendingTransfers + " MB";
|
text: " Pressure State: " + root.gpuTextureMemoryPressureState;
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
text: " Resource Allocated/Populated: " + root.gpuTextureResourceMemory + " / " + root.gpuTextureResourcePopulatedMemory + " MB";
|
text: " Resource Allocated / Populated / Pending: ";
|
||||||
|
}
|
||||||
|
StatText {
|
||||||
|
text: " " + root.gpuTextureResourceMemory + " / " + root.gpuTextureResourcePopulatedMemory + " / " + root.texturePendingTransfers + " MB";
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
text: " Resident Memory: " + root.gpuTextureResidentMemory + " MB";
|
text: " Resident Memory: " + root.gpuTextureResidentMemory + " MB";
|
||||||
|
|
|
@ -42,7 +42,6 @@ GL45VariableAllocationTexture::~GL45VariableAllocationTexture() {
|
||||||
void GL45VariableAllocationTexture::incrementPopulatedSize(Size delta) const {
|
void GL45VariableAllocationTexture::incrementPopulatedSize(Size delta) const {
|
||||||
_populatedSize += delta;
|
_populatedSize += delta;
|
||||||
if (_size < _populatedSize) {
|
if (_size < _populatedSize) {
|
||||||
|
|
||||||
Backend::textureResourcePopulatedGPUMemSize.update(0, delta);
|
Backend::textureResourcePopulatedGPUMemSize.update(0, delta);
|
||||||
} else {
|
} else {
|
||||||
Backend::textureResourcePopulatedGPUMemSize.update(0, delta);
|
Backend::textureResourcePopulatedGPUMemSize.update(0, delta);
|
||||||
|
@ -101,6 +100,9 @@ void GL45ResourceTexture::allocateStorage(uint16 allocatedMip) {
|
||||||
_size = 0;
|
_size = 0;
|
||||||
bool wtf = false;
|
bool wtf = false;
|
||||||
for (uint16_t mip = _allocatedMip; mip < mipLevels; ++mip) {
|
for (uint16_t mip = _allocatedMip; mip < mipLevels; ++mip) {
|
||||||
|
if (_gpuObject.evalMipSize(mip) == 0) {
|
||||||
|
wtf = true;
|
||||||
|
}
|
||||||
_size += _gpuObject.evalMipSize(mip);
|
_size += _gpuObject.evalMipSize(mip);
|
||||||
}
|
}
|
||||||
Backend::textureResourceGPUMemSize.update(0, _size);
|
Backend::textureResourceGPUMemSize.update(0, _size);
|
||||||
|
@ -198,7 +200,6 @@ void GL45ResourceTexture::demote() {
|
||||||
auto numPopulatedDemoted = _populatedMip - oldPopulatedMip;
|
auto numPopulatedDemoted = _populatedMip - oldPopulatedMip;
|
||||||
Size amountUnpopulated = 0;
|
Size amountUnpopulated = 0;
|
||||||
for (int i = 0; i < numPopulatedDemoted; i++) {
|
for (int i = 0; i < numPopulatedDemoted; i++) {
|
||||||
//amountUnpopulated += _gpuObject.getStoredMipSize(oldPopulatedMip + i);
|
|
||||||
amountUnpopulated += _gpuObject.evalMipSize(oldPopulatedMip + i);
|
amountUnpopulated += _gpuObject.evalMipSize(oldPopulatedMip + i);
|
||||||
}
|
}
|
||||||
decrementPopulatedSize(amountUnpopulated);
|
decrementPopulatedSize(amountUnpopulated);
|
||||||
|
|
|
@ -429,7 +429,8 @@ public:
|
||||||
//
|
//
|
||||||
// Here are the static function to compute the different sizes from parametered dimensions and format
|
// Here are the static function to compute the different sizes from parametered dimensions and format
|
||||||
// Tile size must be a power of 2
|
// Tile size must be a power of 2
|
||||||
static uint16 evalTiledLength(uint16 length, int tile) { return length / tile + ((~length & tile) != 0); }
|
static uint16 evalTiledPadding(uint16 length, int tile) { int tileMinusOne = (tile - 1); return (tileMinusOne - (length + tileMinusOne) % tile); }
|
||||||
|
static uint16 evalTiledLength(uint16 length, int tile) { return length / tile + (evalTiledPadding(length, tile) != 0); }
|
||||||
static uint16 evalTiledWidth(uint16 width, int tileX) { return evalTiledLength(width, tileX); }
|
static uint16 evalTiledWidth(uint16 width, int tileX) { return evalTiledLength(width, tileX); }
|
||||||
static uint16 evalTiledHeight(uint16 height, int tileY) { return evalTiledLength(height, tileY); }
|
static uint16 evalTiledHeight(uint16 height, int tileY) { return evalTiledLength(height, tileY); }
|
||||||
static Size evalLineSize(uint16 width, const Element& format) { return evalPaddedSize(evalTiledWidth(width, format.getTile().x) * format.getSize()); }
|
static Size evalLineSize(uint16 width, const Element& format) { return evalPaddedSize(evalTiledWidth(width, format.getTile().x) * format.getSize()); }
|
||||||
|
|
|
@ -49,7 +49,7 @@ Item {
|
||||||
{
|
{
|
||||||
prop: "textureResidentGPUMemSize",
|
prop: "textureResidentGPUMemSize",
|
||||||
label: "Resident",
|
label: "Resident",
|
||||||
color: "#FF6309"
|
color: "#A2277C"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "textureFramebufferGPUMemSize",
|
prop: "textureFramebufferGPUMemSize",
|
||||||
|
@ -69,7 +69,7 @@ Item {
|
||||||
{
|
{
|
||||||
prop: "texturePendingGPUTransferSize",
|
prop: "texturePendingGPUTransferSize",
|
||||||
label: "Transfer",
|
label: "Transfer",
|
||||||
color: "#A2277C"
|
color: "#FF6309"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue