Add ideal resource texture memory stat

This commit is contained in:
Brad Davis 2018-05-17 14:29:06 -07:00
parent fb81cf927a
commit ae07036f20
5 changed files with 21 additions and 2 deletions

View file

@ -281,10 +281,12 @@ Item {
text: " Pressure State: " + root.gpuTextureMemoryPressureState;
}
StatText {
text: " Resource Allocated / Populated / Pending: ";
property bool showIdeal: (root.gpuTextureResourceIdealMemory != root.gpuTextureResourceMemory);
text: " Resource Allocated " + (showIdeal ? "(Ideal)" : "") + " / Populated / Pending: ";
}
StatText {
text: " " + root.gpuTextureResourceMemory + " / " + root.gpuTextureResourcePopulatedMemory + " / " + root.texturePendingTransfers + " MB";
property bool showIdeal: (root.gpuTextureResourceIdealMemory != root.gpuTextureResourceMemory);
text: " " + root.gpuTextureResourceMemory + (showIdeal ? ("(" + root.gpuTextureResourceIdealMemory + ")") : "") + " / " + root.gpuTextureResourcePopulatedMemory + " / " + root.texturePendingTransfers + " MB";
}
StatText {
text: " Resident Memory: " + root.gpuTextureResidentMemory + " MB";

View file

@ -354,6 +354,7 @@ void Stats::updateStats(bool force) {
STAT_UPDATE(gpuTextureResidentMemory, (int)BYTES_TO_MB(gpu::Context::getTextureResidentGPUMemSize()));
STAT_UPDATE(gpuTextureFramebufferMemory, (int)BYTES_TO_MB(gpu::Context::getTextureFramebufferGPUMemSize()));
STAT_UPDATE(gpuTextureResourceMemory, (int)BYTES_TO_MB(gpu::Context::getTextureResourceGPUMemSize()));
STAT_UPDATE(gpuTextureResourceIdealMemory, (int)BYTES_TO_MB(gpu::Context::getTextureResourceIdealGPUMemSize()));
STAT_UPDATE(gpuTextureResourcePopulatedMemory, (int)BYTES_TO_MB(gpu::Context::getTextureResourcePopulatedGPUMemSize()));
STAT_UPDATE(gpuTextureExternalMemory, (int)BYTES_TO_MB(gpu::Context::getTextureExternalGPUMemSize()));
#if !defined(Q_OS_ANDROID)

View file

@ -126,6 +126,7 @@ private: \
* @property {number} gpuTextureResidentMemory - <em>Read-only.</em>
* @property {number} gpuTextureFramebufferMemory - <em>Read-only.</em>
* @property {number} gpuTextureResourceMemory - <em>Read-only.</em>
* @property {number} gpuTextureResourceIdealMemory - <em>Read-only.</em>
* @property {number} gpuTextureResourcePopulatedMemory - <em>Read-only.</em>
* @property {number} gpuTextureExternalMemory - <em>Read-only.</em>
* @property {string} gpuTextureMemoryPressureState - <em>Read-only.</em>
@ -270,6 +271,7 @@ class Stats : public QQuickItem {
STATS_PROPERTY(int, gpuTextureResidentMemory, 0)
STATS_PROPERTY(int, gpuTextureFramebufferMemory, 0)
STATS_PROPERTY(int, gpuTextureResourceMemory, 0)
STATS_PROPERTY(int, gpuTextureResourceIdealMemory, 0)
STATS_PROPERTY(int, gpuTextureResourcePopulatedMemory, 0)
STATS_PROPERTY(int, gpuTextureExternalMemory, 0)
STATS_PROPERTY(QString, gpuTextureMemoryPressureState, QString())
@ -918,6 +920,13 @@ signals:
*/
void gpuTextureResourceMemoryChanged();
/**jsdoc
* Triggered when the value of the <code>gpuTextureResourceIdealMemory</code> property changes.
* @function Stats.gpuTextureResourceIdealMemoryChanged
* @returns {Signal}
*/
void gpuTextureResourceIdealMemoryChanged();
/**jsdoc
* Triggered when the value of the <code>gpuTextureResourcePopulatedMemory</code> property changes.
* @function Stats.gpuTextureResourcePopulatedMemoryChanged

View file

@ -270,6 +270,7 @@ ContextMetricCount Backend::texturePendingGPUTransferCount;
ContextMetricSize Backend::texturePendingGPUTransferMemSize;
ContextMetricSize Backend::textureResourcePopulatedGPUMemSize;
ContextMetricSize Backend::textureResourceIdealGPUMemSize;
Size Context::getFreeGPUMemSize() {
return Backend::freeGPUMemSize.getValue();
@ -329,3 +330,7 @@ Size Context::getTexturePendingGPUTransferMemSize() {
Size Context::getTextureResourcePopulatedGPUMemSize() {
return Backend::textureResourcePopulatedGPUMemSize.getValue();
}
Size Context::getTextureResourceIdealGPUMemSize() {
return Backend::textureResourceIdealGPUMemSize.getValue();
}

View file

@ -113,6 +113,7 @@ public:
static ContextMetricCount texturePendingGPUTransferCount;
static ContextMetricSize texturePendingGPUTransferMemSize;
static ContextMetricSize textureResourcePopulatedGPUMemSize;
static ContextMetricSize textureResourceIdealGPUMemSize;
protected:
@ -243,6 +244,7 @@ public:
static Size getTexturePendingGPUTransferMemSize();
static Size getTextureResourcePopulatedGPUMemSize();
static Size getTextureResourceIdealGPUMemSize();
protected:
Context(const Context& context);