Page 1 of 1

Mobile DirectDraw: Video Memory Issues

PostPosted: Jun 22, 2008 @ 10:29pm
by Johan
Hey,

I have been looking into the Windows Mobile implementation of DirectDraw a bit, and have some questions. Maybe someone here can help me out a bit.

1. Available video memory (dwVidMemTotal)

Most of my devices only report back a few hundred kb of total video memory. My HTC 7500 as an example reports back 196608 bytes of video memory = 192 kb. Considering that the screen is 600 kb (640x480x2), 192 kb is really nothing. Changing bitmap cache settings does not change this.

Does anyone know of any device that has more available video ram for DirectDraw to try out? Or is this some odd limitation with DirectDraw Mobile?

2. Cannot create surfaces in video memory

Well, even if 192 kb of video memory is not much, at least it could be used for something good, right? Wrong. If I create my surfaces with DDSD_CAPS and my dwCaps set to DDSCAPS_VIDEOMEMORY CreateSurface() fails with DDERR_INVALIDCAPS. The interesting thing is that this is on an actual device where GetCaps() returns that DDSCAPS_VIDEOMEMORY is indeed a valid flag to use!

So, my second question is: Is it possible at all to create offscreen surfaces in video memory using DirectDraw mobile? Because on two of my devices that reports that they support video surfaces it is apparently not possible.

I'm thankful for any replies you might have. I have searched the forums and all over the Internet but it appears not many try to call CreateSurface on mobile devices to create surfaces in video memory.

Sincerely
Johan

PostPosted: Jun 25, 2008 @ 8:08pm
by Digby
What does dwVidMemFree report?

Regarding issue 2, if you make the same call to CreateSurface and use DDSCAPS_SYSTEMMEMORY instead of DDSCAPS_VIDEOMEMORY, does the call succeed?

If you don't specify a memory pool flag and the surface is created successfully, what does GetSurfaceDesc report for the memory pool of that new surface?

PostPosted: Jun 26, 2008 @ 9:26pm
by Johan

PostPosted: Jun 29, 2008 @ 4:21am
by Cardinal
I've toyed with DirectX Mobile quite a bit and have run into the problems your encountering.

1) From what I've come to understand is that most devices have JUST enough video memory to house the primary surface. Sometimes the device has a bit of extra video ram left which is why the free vidmem amount is so small.

2) Creating surfaces in video memory generally doesn't seem to work as there isn't ever enough room there to create a big surface. Maybe small ones that are <= to the free vid mem size.

3) As for hardware blitting, that only seems to work when you can do it from video memory TO video memory. Although some devices take advantage of onboard DMA channels to get it from sys memory to vid memory whilst bypassing the CPU.

I've come to the conclusion that DirectX Mobile is broken and isn't much use to me. I've had WAY better success using PocketHAL and my own blit routines.