Sign in to follow this  

D3DPOOL problems

This topic is 4165 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'm writing a small pong like game and i'm having problems creating Multiple surfaces. When I call CreateoffScreenSurface with D3DPOOL_DEFAULT, The call to CreateoffScreenSurface fails when I try to create more than 3 surfaces. When I tried using D3DPOOL_SYSTEMMEM, I waas able to create more than three offscreen surfaces, however; when I tried to display them to the screen using StretchRect, that didn't work! Does anyone have a clue as to what's going on? ~Brian Wright

Share this post


Link to post
Share on other sites
How big are the surfaces you are creating, and how much other GPU memory are you using? GPUs usually have less memory than the System memory, so it's likely it would run out before the system memory does.

As for StretchRect, it only supports surfaces in the Default pool, and if one of the two is an "offscreen plain surface", the other must as well.

Hope this helps.

Share this post


Link to post
Share on other sites
The surfaces I am creating are about 2MB. But even when I tried loading a 1K surface, it would only allow me to load two surfaces. I have no idea how much GPU memory i'm using. Is there a way I can find out how much GPU memory i'm using? Is there a function that can blit to the screen in D3DPOOL_SYSTEMMEM?

Share this post


Link to post
Share on other sites
Take a look at IDirect3DDevice9::UpdateSurface, that should do the trick.

Also, you can get an estimate of remaining GPU memory using IDirect3DDevice9::GetAvailableTextureMem.

Hope this helps.

Share this post


Link to post
Share on other sites
Ok, that helps, thanks. It seems I should be able to create more than 3 surfaces even if D3DPOOL_DEFAULT is specified. Could there be a problem with my code? Or is my GPU memory just being used by some unknown application on my computer? (I'm guessing GPU stands for Graphics Processing Unit).

Share this post


Link to post
Share on other sites
What graphics card do you have, and how much VRAM does it have? Remember the frontbuffer, backbuffer and z-buffer will be in VRAM. Are you creating any resources in the managed pool before? You shouls always create default pool resources first, otherwise the managed pool will use up all the VRAM.

GetAvailableTextureMem() is pretty much uselsss for this sort of thing, that includes AGP memory. On my old GeForce 2, it reported ~256MB available, despite my card only having 32MB of VRAM (I think those numbers are right).

Share this post


Link to post
Share on other sites

This topic is 4165 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this