This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Mobile DirectDraw: Video Memory Issues


Mobile DirectDraw: Video Memory Issues

Postby Johan » Jun 22, 2008 @ 10:29pm

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
Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby Digby » Jun 25, 2008 @ 8:08pm

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?
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby Johan » Jun 26, 2008 @ 9:26pm

Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby Cardinal » Jun 29, 2008 @ 4:21am

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.
Cardinal
pm Member
 
Posts: 53
Joined: Feb 6, 2006 @ 5:39am
Location: Ottawa, Ontario


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron