Jump to content
  • Advertisement
Sign in to follow this  
user88

MultiSample + Multiple DX9Device instances = OutOfVideoMemory

This topic is 3348 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I have a multiple instances of DX9Device in my application. Each of that instances takes video memory to create such resources as frame buffer, back buffer... There many windows or controls which creates dx device when appearers. Because of many Control had created own devices already in that time i need to find out the maximum value of AA MultiSampling for available free video memory. Can you give me any suggestions how to do that? I suppose that i should make some calculations:
MSAA = Avalible_Video_Mem - Width * Height * FrameBuffer_Bits * Depth_BufferBits > 0 ? MaxMSAA : No_Or_LessMSAA;

Share this post


Link to post
Share on other sites
Advertisement
You can't reliably figure out the amount of free device memory. The driver will never give you a reliable number, it could change at any time since your app may not have exclusive use of the GPU. On Vista/Win7 you also have virtualized device memory to deal with.

Anyway you really don't want a new device for each Control or window, that's completely overkill. Just have your one device Present to each window one at a time, or use a swap chain.

Share this post


Link to post
Share on other sites
Quote:
Anyway you really don't want a new device for each Control or window, that's completely overkill.

Do you know whether i will have problems with threads and single dx device instance? I heard that each Form (i mean window in .net Framework) creates own thread when it instantiates. So, there can be some problems with single device.. What do you think about that?

Share this post


Link to post
Share on other sites
Quote:
Original post by user88
Quote:
Anyway you really don't want a new device for each Control or window, that's completely overkill.

Do you know whether i will have problems with threads and single dx device instance? I heard that each Form (i mean window in .net Framework) creates own thread when it instantiates. So, there can be some problems with single device.. What do you think about that?


Forms do not create their own thread. You completely control which thread accessed a DX device, since your code will be the only code that uses it. If you want it all on one thread, then just do it all on one thread.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!