Jump to content
  • Advertisement
Sign in to follow this  
MysteryX

Use DX9 with LARGEADDRESSAWARE

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

I want to allow using up to 4GB of memory when using DirectX9. Currently, when memory usage goes too high, I get this message:

access violation at 0x000E8AE5 in C:\WINDOWS\SYSTEM32\d3dx9_43.dll,
attempting to read from 0xE47DE9C0

I'm running my DLL via AVSMeter.exe which has the /LARGEADDRESSAWARE compilation flag.

 

Then in my code

https://github.com/mysteryx93/AviSynthShader/blob/master/Src/D3D9RenderImpl.cpp#L313

 

I replace

HR(D3DXGetShaderConstantTable((DWORD*)ShaderBuf, &Shader->ConstantTable));

with

HR(D3DXGetShaderConstantTableEx((DWORD*)ShaderBuf, D3DXCONSTTABLE_LARGEADDRESSAWARE, &Shader->ConstantTable));

 

I still get the same error message. What else do I need to change to make it work?

Share this post


Link to post
Share on other sites
Advertisement

Nobody has an idea on this one? Basically, it *should* be working but isn't?

 

I'm using an EXE such as AvsMeter that has the 4GB patch, which loads the AVS script file and loads AviSynth.dll, which then loads my DLL, and the crash occurs within DirectX when memory usage gets too high.

 

If it *should* be working, any reason why it wouldn't?

Share this post


Link to post
Share on other sites
There is one solution that can work for you.

Your problem obviously is that you're running out of virtual address space (past 2GB).

You can refactor your code so that you use expanded memory instead. The idea is to work on a small amount of virtual memory chunks while the physical memory backing that is much larger. So you can use for example 6GB of physical memory but only read 128 MBs using pointers at a time.

Read Myth: Without /3GB a single program can't allocate more than 2GB of virtual memory on how to do that. Edited by Matias Goldberg

Share this post


Link to post
Share on other sites

Interesting technique. I don't think it's applicable in my case because I'm not allocating that memory myself. It gets eaten up when too many DX9 devices get created -- which I'm trying to reduce as well but that's a different topic.

Edited by MysteryX

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!