diff --git a/interface/resources/qml/Stats.qml b/interface/resources/qml/Stats.qml
index d961285a46..2406fa048d 100644
--- a/interface/resources/qml/Stats.qml
+++ b/interface/resources/qml/Stats.qml
@@ -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";
diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp
index d54faf8b28..9d86745341 100644
--- a/interface/src/ui/Stats.cpp
+++ b/interface/src/ui/Stats.cpp
@@ -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)
diff --git a/interface/src/ui/Stats.h b/interface/src/ui/Stats.h
index 5c6a3db064..36e923261d 100644
--- a/interface/src/ui/Stats.h
+++ b/interface/src/ui/Stats.h
@@ -126,6 +126,7 @@ private: \
* @property {number} gpuTextureResidentMemory - Read-only.
* @property {number} gpuTextureFramebufferMemory - Read-only.
* @property {number} gpuTextureResourceMemory - Read-only.
+ * @property {number} gpuTextureResourceIdealMemory - Read-only.
* @property {number} gpuTextureResourcePopulatedMemory - Read-only.
* @property {number} gpuTextureExternalMemory - Read-only.
* @property {string} gpuTextureMemoryPressureState - Read-only.
@@ -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 gpuTextureResourceIdealMemory
property changes.
+ * @function Stats.gpuTextureResourceIdealMemoryChanged
+ * @returns {Signal}
+ */
+ void gpuTextureResourceIdealMemoryChanged();
+
/**jsdoc
* Triggered when the value of the gpuTextureResourcePopulatedMemory
property changes.
* @function Stats.gpuTextureResourcePopulatedMemoryChanged
diff --git a/libraries/gpu/src/gpu/Context.cpp b/libraries/gpu/src/gpu/Context.cpp
index 75c80a0164..ad2be7af5e 100644
--- a/libraries/gpu/src/gpu/Context.cpp
+++ b/libraries/gpu/src/gpu/Context.cpp
@@ -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();
+}
diff --git a/libraries/gpu/src/gpu/Context.h b/libraries/gpu/src/gpu/Context.h
index 8c5a4d493e..23c7edaff4 100644
--- a/libraries/gpu/src/gpu/Context.h
+++ b/libraries/gpu/src/gpu/Context.h
@@ -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);