D3DPOOL problems

Started by
4 comments, last by Evil Steve 17 years, 9 months ago
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
Advertisement
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.
Sirob Yes.» - status: Work-O-Rama.
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?
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.
Sirob Yes.» - status: Work-O-Rama.
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).
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).

This topic is closed to new replies.

Advertisement