Hi,

I was considering how complicated it can be to implement a texture replacement policy, and then I had the following idea : we could make use of hardware cocclusion queries on cards that support them to determine actual texture usage and thus have a good texture replacement policy. Here is a simplified view of how this could work :
- a usage counter is added to each texture
- each time a texture is bound, a query is started
- each time a texture is unbound, the counter is read back and added to the corresponding texture counter - after a number of frames, we are able to compute the number of pixels actually contributed to by each texture, and thereby determine texture usage on the fly. Then, we can use this information to move textures to/from agp/video ram accordingly.

Given that occlusion queries are virtually free (at least when supported by the underlying hardware) I think this approach could work quite well. It is also possible to extend it to multitexturing without too much trouble. What do you think ?

Stephane



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to