Skip to main content
GameDev.net gamedev.net
🔒 Locked

Issues with D3D9 texture management

Started by DavidNash Jan 22, 2012 at 4:00 AM 2 replies 1.1k views
Original Post
DavidNash
DavidNash
I am making an editor, I know D3D 11 is already available etc however I want to use D3D9 to maintain backwards compatibility.

Basically the problem with creating a graphical viewport using D3D9 is that to effectively resize without reloading all the resources the D3DPOOL_MANAGED resource pool is very useful, however it maintains a copy of the resources in system memory ...

I want to load the resources to Graphics memory and avoid leaving a copy in system memory for optimization reasons. I several plans ...

a) trying something like creating a very large back buffer and not recreating the device when the d3d9 pane is resized ... this has the problem that I don't have accurate pixels and the behaviour of the screen is more unpredictable.

b) using virtual memory to store the textures and meshes and then on resize simply re-creating the resources with a D3DPOOL_DEFAULT setting for the resource creation.

c) Simply using the D3DPOOL_MANAGED and using compressed meshes and textures ...

if there is a solution in later versions of D3D I would definitely try to support them if available on the system .

Any help is appreciated.
Ripiz
Ripiz
a) You don't have to create very large one, just highest resolution. However I'm not sure how to handle that for fullscreen mode.
b) and c) are pretty much the same. You'll end up remaking [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

D3DPOOL_MANAGED.

[/font]

What's wrong with reloading everything from disk? If your data is baked it won't take long.

21st Century Moose
21st Century Moose
I'd just run with c; it's going to make your life a lot easier in the longer term.
Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls. 
Evil Steve
Evil Steve
You could create your device with a 1x1 pixel backbuffer initially, and then create a new swap chain with IDirect3DDevice9::CreateAdditionalSwapChain(). Then, when the window is resized, you can re-create the swap chain without having to Reset() the device.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.