Keith Whitwell wrote:
I'm still working on the age stuff, but the general strategy is to not release memory back into the pool until it is guarenteed no longer referenced. This means hanging onto it for a little while until perhaps the end of a frame or until the next time you notice the engine is idle.
Note that the via doesn't provide any nice IRQ notification for tracking engine progress - you could do a lot better with that sort of mechanism.
One of the key elements in all of my memory management ideas is being able to efficiently implement something like GL_NV_fence. After each batch of rendering commands (to some granularity) you set a fence. Each object in memory tracks the most recently set fence that bounds its usage. When that fence has past (i.e., TestFenceNV would return TRUE), that object can be booted.
Maybe implementing GL_NV_fence for a couple "interesting" cards would be a good idea? The trick is implementing such that the driver and application can use it at the same time without causing fence ID conflicts. The fence IDs are defined as GLuint, so maybe we could interally use uint64_t. If the upper 32-bits are zero it's an application ID, otherwise it's a driver-private ID. Dunno...
I've come to the same conclusion myself...
The via driver is currently using a 2d blit to write back a 32bit counter value to a per-context private piece of memory from which the driver can figure out which parts of the command stream have been processed. This is a development of the aging mechanisms in the other drivers, but applied a little more rigorously across the driver.
Keith
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel