summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common/texmem.h
diff options
context:
space:
mode:
authorFelix Kuehling <fxkuehl@gmx.de>2005-02-03 21:40:21 +0000
committerFelix Kuehling <fxkuehl@gmx.de>2005-02-03 21:40:21 +0000
commit64b85b456384c22834749a278d073eefd3056611 (patch)
treecbad5e6109be5dae090602c165663fa466b5e329 /src/mesa/drivers/dri/common/texmem.h
parent9ea600ff3ffcddbb1431e478ae24517672d32423 (diff)
Use all texture heaps in a fair way when textures need to be kicked in
order to make room for new textures. In particular this fixes texture trashing on the first heap when the second heap is occupied by currently unused textures (observed with Torcs and the Savage driver). Heaps are weighted by their sizes by default but drivers can override these and apply their own weights based on relative texture upload speeds to the respective heaps.
Diffstat (limited to 'src/mesa/drivers/dri/common/texmem.h')
-rw-r--r--src/mesa/drivers/dri/common/texmem.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/texmem.h b/src/mesa/drivers/dri/common/texmem.h
index 266afd8bb6..705cd4d344 100644
--- a/src/mesa/drivers/dri/common/texmem.h
+++ b/src/mesa/drivers/dri/common/texmem.h
@@ -216,6 +216,23 @@ struct dri_tex_heap {
* framebuffer.
*/
unsigned timestamp;
+
+ /** \brief Kick/upload weight
+ *
+ * When not enough free space is available this weight
+ * influences the choice of the heap from which textures are
+ * kicked. By default the weight is equal to the heap size.
+ */
+ double weight;
+
+ /** \brief Kick/upload duty
+ *
+ * The heap with the highest duty will be chosen for kicking
+ * textures if not enough free space is available. The duty is
+ * reduced by the amount of data kicked. Rebalancing of
+ * negative duties takes the weights into account.
+ */
+ int duty;
};