Managed Pool Questions

elikakohen

Newcomer
Joined
Sep 16, 2003
Messages
13
Location
USA
Hello all,

How do you get the Managed Pool to Load and Cache Textures for you?:confused:

Problem Description -

I started a project with multiple views using only one device and one swap chain.

This is when I learned that most of the DirectX 9 functional implementations are really confusing state machines. (Lots of stuff is global.):eek:

What really irked me is that VertexBuffers and Textures can not exist without a device. I wanted to do this so I could share VertexBuffers and Textures among multiple devices. These means that I have to multiple instances of the same "model". One for each device.:mad:

What I started doing was caching the CustomVertex arrays and loading them into the GraphicsStream upon every render. So far the rendering wasn't so bad.

Then I tried to do the same with Textures. OUCH. Okay. So I created these memory streams to make sure that there was only one instance of the texture in my application. Before I render the object, I check my "Texture Cache" to see if it is loaded. If it is, I proceed to load the texture onto the first texture stage. (TextureLoader.FromStream() )

This is painfully slow and slows down my application enormously.

Which brings me back to my question..

- Isn't the managed pool supposed to do all of this for you?

I would really like for Direct3D to ask my application for a texture if it ever needs one. However, I would really like it to cache these textures on the video card and in the phantom, "Managed Pool memory cloud in that wonderful state of bliss somewhere but not here...". :D


Anyhoo.


It looks like I can only cache 8 textures, (one for each texture stage) and then I have to reload them everytime I want to render a new model.

However, I am kinda hoping that StateBlocks will help solve the problem of all of this. Although I can not see how... Can someone help?:-\

Thanks again for the help.
 
Back
Top