Skip to main content
gamedev.net
🔒 Locked

DX Memory Optimization

Started by Daishim Feb 1, 2004 at 1:25 PM 3 replies 300+ views
Original Post
Daishim
Daishim
Since Directx does a lot of optimization of things on it''s own in terms of memory allocation, I vaguely remember something about it also deciding whether there is sufficient space in the hardware(sound/video) memory for the data(surfaces/buffers) and stores it there when possible. However, I may be remembering wrong or just having wishful thoughts. Is this a safe assumption, or is that kind of optimization of deciding where to put memory is up to the programmer?

I know only that which I know, but I do not know what I know.

I know only that which I know, but I do not know what I know.
Raloth
Raloth
If there is not space left in the hardware, the driver will take something out and put what it needs in. This is ok in some cases where you wouldn''t gain anything from worrying about it, but if it is happening every frame you have a problem.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
Erzengeldeslichtes
Erzengeldeslichtes
D3DPOOL_DEFAULT will decide where to put it, prefering to put it in video memory but putting it in system memory if it can't put it in video memory. Othe pools put it in system memory with varying optimizations to the video card (managed copies to the device memory when needed, systemmem doesn't go to the card very often). Usually default is quickest, managed is safest (doesn't need to be reset after a device loss), and systemmem is only good if you're doing a lot of CPU processing on the surface/buffer. It is up to you as the programmer to let D3D know which optimization technique it should use.

I don't know about DirectSound, sorry.

[edited by - Erzengeldeslichtes on February 1, 2004 2:34:28 PM]
----Erzengel des Lichtes光の大天使Archangel of LightEverything has a use. You must know that use, and when to properly use the effects.♀≈♂?
Raloth
Raloth
quote:
Original post by Erzengeldeslichtes
D3DPOOL_DEFAULT will decide where to put it, prefering to put it in video memory but putting it in system memory if it can''t put it in video memory. Othe pools put it in system memory with varying optimizations to the video card (managed copies to the device memory when needed, systemmem doesn''t go to the card very often). Usually default is quickest, managed is safest (doesn''t need to be reset after a device loss), and systemmem is only good if you''re doing a lot of CPU processing on the surface/buffer. It is up to you as the programmer to let D3D know which optimization technique it should use.

I don''t know about DirectSound, sorry.


Sigh...

Default will always try to put it in the hardware. Managed keeps a copy in software to do modifications to and then sends that to the hardware on updates or resets. You still have to call reset on a lost device even with managed, it''s just easier to handle. Managed also watches for some redundant state checks. Use default if you are very careful and you need that extra few clock cycles, otherwise it''s more trouble than it''s worth. Software keeps everything in software and sends it to the video card every time it is used. Aka it is very slow, and should only be used if you are modifying something like a texture almost every frame.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
Erzengeldeslichtes
Erzengeldeslichtes
Perhaps I should have said doesn''t need to be reloaded? Thanks for the info that redundant states are watched by managed. Otherwise everything you said is essentially the same as mine. (Default = fastest, managed = safest, systemmem = CPU based) Hardly worthy of a sigh.
----Erzengel des Lichtes光の大天使Archangel of LightEverything has a use. You must know that use, and when to properly use the effects.♀≈♂?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.