Jump to content
  • Advertisement
Sign in to follow this  
wolfcom

D3DERR_OUTOFVIDEOMEMORY strange

This topic is 3944 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

vs2005 debug mode: the firt time run it, the debug result: Create Device Direct3D9: (INFO) :======================= Hal HWVP device selected Direct3D9: (ERROR) :Failed to create driver primary surface chain Direct3D9: (ERROR) :Failed to initialize primary swapchain Direct3D9: (ERROR) :Failed to initialize Framework Device. CreateDevice Failed. D3D9 Helper: IDirect3D9::CreateDevice failed: D3DERR_OUTOFVIDEOMEMORY Direct3D9: (INFO) :======================= Hal HWVP device selected Direct3D9: (ERROR) :Failed to create driver primary surface chain Direct3D9: (ERROR) :Failed to initialize primary swapchain Direct3D9: (ERROR) :Failed to initialize Framework Device. CreateDevice Failed. D3D9 Helper: IDirect3D9::CreateDevice failed: D3DERR_OUTOFVIDEOMEMORY First-chance exception at 0x7c812a5b in 3D.exe: Microsoft C++ exception: XGError at memory location 0x0013fa24.. Create Device FAILED First-chance exception at 0x7c812a5b in 3D.exe: Microsoft C++ exception: XGError at memory location 0x0013fa4c.. The program '[3416] 3D.exe: Native' has exited with code 0 (0x0). then second time run it the debug result: Direct3D9: (INFO) :======================= Hal HWVP device selected D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 1.58456e+029f. This is ok. Create Device Succeed Create XGRender Direct3D9: (ERROR) :Can specify D3DLOCK_DISCARD or D3DLOCK_NOOVERWRITE for only Vertex Buffers created with D3DUSAGE_DYNAMIC D3D9 Helper: IDirect3DVertexBuffer9::Lock failed: D3DERR_INVALIDCALL First-chance exception at 0x10072458 (Test.dll) in 3D.exe: 0xC0000005: Access violation writing location 0x00000000. Unhandled exception at 0x10072458 (Test.dll) in 3D.exe: 0xC0000005: Access violation writing location 0x00000000. The program '[1068] 3D.exe: Native' has exited with code 0 (0x0). cann't create device first time but run again there is no problem! how to create device successfully first time? as you see: Can specify D3DLOCK_DISCARD or D3DLOCK_NOOVERWRITE for only Vertex Buffers created with D3DUSAGE_DYNAMIC my code: HRESULT XGCreateVertexBuffer(UINT Length, DWORD IDirect3DVertexBuffer9** ppVertexBuffer, DWORD Usage = 0, D3DPOOL Pool =D3DPOOL_MANAGED,HANDLE*pSharedHandle = NULL); m_pVertexBuffer->Lock(0, 0, (void **)&pVertex, D3DLOCK_DISCARD); i have used the D3DLOCK_DISCARD!?

Share this post


Link to post
Share on other sites
Advertisement
A call to IDirect3D9::CreateDevice, even if it fails, might change the settings of the passed presentation parameters struct to correct or supported values. So calling it a second time could work without problems. Try it out. Check if the present params values change after the failed IDirect3D9::CreateDevice call.

Share this post


Link to post
Share on other sites
but if i add follow codes before CreateDevice:
if (!windows)
{
m_pD3D9->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &displayMode);
XGChangeDisplayMode(32, 800, 600);

if (D3DFMT_A1R5G5B5 == displayMode.Format ||
D3DFMT_R5G6B5 == displayMode.Format ||
D3DFMT_X1R5G5B5 == displayMode.Format)
{
dmBitsPerPel = 16;
}
else
{
dmBitsPerPel = 32;
}

//XGChangeDisplayMode(32, 1024, 768);
XGChangeDisplayMode(dmBitsPerPel, displayMode.Width, displayMode.Height);
}

it is just Ok...

i hava tried my best to find the reason


i think that if the app change the display mode
it can flush the video memory :)

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!