PDA

View Full Version : laptops with shared video memory


svero
11-10-2005, 11:17 PM
One of my games running in 2D mode use to just store all it's graphics (10-12mb) in video memory. If I run the same game using the popcap engine it reports 1.2mb of vid mem used and runs really slowly. It only runs really slowly on a laptop with that shared video/sys memory. Does anyone know about 2d mem manangement and whether that shared style mem on laptops could cause really poor performance using straight direct draw with surfaces in system mem? Using d3d it runs great... but d3d seems to manage memory correctly.. ie swapping into vid mem what its blitting.

princec
11-11-2005, 02:32 AM
DDraw requires you to be specific about where you want your surfaces allocated. So if you don't ask for VRAM, it'll be slow as hell, especially if there's any blending to be done.

Cas :)

svero
11-11-2005, 02:45 AM
Its not slow at all on most standard pc's though. Just on this laptop. I thought maybe it had to do with the shared vid system mem being slower access. Is there no DDraw memory management for surfaces? the way d3d does it?

princec
11-11-2005, 02:59 AM
Shared video ram is slower but should only be, say, 50% slower. Not hugely slower. But you might need to be a bit more explicit about how you allocate it. More than that I can't say though coz it's been years since I did DDraw :)

...er why bother with it anyway when you have a working D3D one?

Cas :)

PeterM
11-11-2005, 03:01 AM
This is how I understand it - it may not be 100% correct:

The situation is a bit different from the usual "lots of VRAM, so bung everything there".

Instead, there is very little actual VRAM, so you've got no choice but to store most surfaces (sprites, backgrounds etc) in system RAM.

As in the usual setup, doing blits from system memory to VRAM is slow. You probably want to ensure that your back buffer is in system memory too, so all your blits (apart from the final back buffer -> primary surface blit) are from system memory to system memory.

When using SDL this is the fastest way anyway, since locking DirectDraw surfaces to perform alpha blending lowers your frame rate way down.