Archived

This topic is now archived and is closed to further replies.

DigitalDragon505

video memory question

Recommended Posts

i am using DirectX7 for my 2D game. and the problem is in the fact that i have about 50 MB''s in textures. now i wonder if i load it all,what will happen? for example if i have a card with 32MB''s. will the rest of the textures be lost or stored in system memory and accesed via AGP? or something else?

Share this post


Link to post
Share on other sites
Crawl    136
Haven''t worked with DirectX but it''s possible to specify where you want your textures to be stored,... right...?? If so, it''s probably wise to store frequently used in video memory and others in system memory,....

just my 2 eurocents....

Share this post


Link to post
Share on other sites
the problem is that 49 MB''s of that data are used frequently.

though i am curious,how will speed be affected if textures are stored in system memory. i only need 64x64 rect of those textures at a time multiplied by the number of units of that type on screen?

Share this post


Link to post
Share on other sites
S1CA    1418
1) Under DirectDraw, if you run out of video memory then your CreateSurface() style calls will fail (assuming you''ve explicitly specified local video memory).

2) You can also specify non-local video memory which is AGP memory. The graphics chip can still access this directly and very quickly* so it''s usually fine to use for most things.

3) If you''re using Direct3D, then use "managed" resources (even under DX7) - it does a really good job for a little bit of overcommit.

4) There''s no escaping coming up with a strategy for this stuff - for a DirectX 7 2D game, many people are going to expect to be able to use it on 2Mb PCI only graphics chips. You''ll have to do some amount of system->video memory transfers. Whether you scale back the content or upload before each Blt(), you''ll have to do _something_ when the machine you''re running on is below expected spec **.

[* "very quickly" == the speed of your AGP bus, e.g. with the "Fast PCI" clock running at 66MHz, one DWORD is transferred each cycle - multiply that by the ''x'', so AGP1x = 264MB/sec (66*sizeof(DWORD)), AGP2x = 528MB/sec etc]

[** even some 3D games are expected to work to some extent on ancient 2MB hardware - when I was doing the engine for Pac-Man:Adventures in Time this was a big issue - it had to work on 2Mb chips, but there was at least 2Mb of textures required per frame - the two solutions used were managed textures and a user option to scale the sizes of all textures to fit comfortably into VRAM (the engine automatically dropped mipmaps etc but left the "scale or run slow" option to the user).]

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
jdinger2    122
Just curious: are these bitmaps 8 bit, 24 bit, etc? If a particular bitmap only has, say, 156 distinct colors but is 24 bit, then you''re wasting a ton of size there. You can use PaintShopPro or PhotoShop, etc, to reduce the bit depth and give it a unique palette (ie: NOT the standard Windows 256 color palette) and shrink your bitmaps down A LOT.

And if you already know this, then, I just wasted my time...

MSVC++ 6
DirectX 7

Share this post


Link to post
Share on other sites