[YANN] Sliding Slot...

Started by
5 comments, last by Freaky 19 years, 10 months ago
After several attempts at implementing a vertex buffer management system I have yet to find the most optimal solution. Then the sliding slot structure came to mind. I remembered reading about it some time ago and I''m struggling with the proper structures to make it fast enough. I''ve tried it using a binary tree and that isn''t very speedy. When concatenating several nodes into a larger one I need to invalidate some parts of the branch. My current implementation never deletes nodes. It just invalidates them. Maybe this is the error in my implementation. I''ll try that later. If anyone has got a better structure to manage the buffers in then please spill . Thx in advance - Freaky
Advertisement
As to how do you want them managed? I''ve implemented my own vertex buffer manager for handling static and dynamic vertex buffers. However I am unsure as to what it is that you want your vertex buffer manager to manage. Could you please elaborate more on what you need it to do?
The problem that I have with the sliding slot approche that I have tried to implement is when I need to join slots of the same granularity into a bigger slot.

In order to join two slots, they must follow each other in the vertex buffer. So before join the slots that I have selected, I need to find a way to move the slots so that the are following each other and then collapse the slots in a bigger one but I haven''t found a clean way to do that...

Is there someone that had a similar problem?
Thomas DecroyèreCheck out my blog at: http://thomas.decroyere.be
Yop, I had that problem as well, but my mgr wasn''t very important right when I was working on it so I still haven''t worked on any solutions

If u split the chunks into a binary tree, then you know that you must join children with the same parent (to keep to the binary buddy system, or sliding slot if it works in the same way). Therefore, look in all parents and see if one got two empty children; joining them is simply a matter of removing the children. Otherwise, look for two parents with one empty child each and interchange the data in the children so that one parent gets two empty children. Will require a copy, you could do that over frames if the chunks are huge though.

Only my thoughts for now though...
Shaigan: why can''t you just invalidate two slots next to each other? And the combine them. Next frame, when the original data is needed, the manager will see it''s not valid anymore, request a new slot of that side, and recopy the data. I think that''s how it''s normally done.
I was thinking of invalidate the next slots but what happen if for example I need to join 2 64K slots into a 128K slot but the next slot is not a 64K slot?

When my video memory manager makes several joins/splits, the vertex buffer fragment itself. Meaby I could defragment the vertex buffer so I group slots with the same granularity together but that require copying the content of the slots.

[edited by - shaigan on May 28, 2004 6:25:51 AM]
Thomas DecroyèreCheck out my blog at: http://thomas.decroyere.be
quote:Original post by Shaigan
I was thinking of invalidate the next slots but what happen if for example I need to join 2 64K slots into a 128K slot but the next slot is not a 64K slot?


No it might not be a 64K slot at the moment, but it will be a 64K slot that has been split into smaller slots say 32K and two 16K. You simply have to recurse down the tree combining slots to then get the required contingent memory block.

James

This topic is closed to new replies.

Advertisement