Argh! What do GeForce cards do when texture memory is full?

Started by
3 comments, last by Cambo_frog 19 years, 8 months ago
Hi, I'm trying to do environment mapping with a 6 sided 1024x1024 envmap. Everything is ok if I have enough video mem. The texture is in POOL_MANAGED since it is created with D3DXCreateCubeTextureFromFile. So I may think that it is swapped out to main memory if needed (I have another textures and surfaces of course). When I tested it on a Mobility Radeon 7500 with 32MByte, the 1024x1024 cube didn't fit in, so Directx told me its warnings and dropped my texture.

Direct3D9: (WARN) :Texture cache thrashing. Removing MRU texture.
Direct3D9: (INFO) :Removed texture with timestamp 0,78 (current = 88).
Direct3D9: (ERROR) :All POOL_MANAGED resources in this device freed. No further video memory available.
Direct3D9: (ERROR) :The resource manager failed to promote or update a dirty texture. The texture will be disabled.

It's ok, if it does not fit in, then drop it (actually, I don't know, why doestn't it swap to main memory.. it would be slow, but wolud work). On this card, 512x512 texture is ok, works perfectly. Then I tried it on some GeForce cards. GeForce4 MX 420 with 64 MBytes of memory works well with 512x512, but when trying the bigger one, it does not unload but does very ugly things, the screen breaks, colors get dark, etc.. I tried the same on another GeForce MX 420, it created random-like polygons and things like that... So my question is that: -why does it load the texture at all if it won't fit in? (D3DXCreateCubeTextureFromFile returnd D3D_OK) -why doesn't it manage the low-memory situation as correctly as it should? it's useless like this. (I even tried D3DCREATE_DISABLE_DRIVER_MANAGEMENT but the effect is the same). Anyone had these problems before? Thanks for your help, Peter
------------------------------------------------------------Neo, the Matrix should be 16-byte aligned for better performance!
Advertisement
Check the maximum texture size on your card (D3D Caps viewer in SDK). I know my ancient voodoo 3 could not use anything bigger than 256x256. My Radeon 9200 can handle them up to 2048x2048. If you card can't support large textures like that, you may have to break it up into smaller pieces.

[Edited by - Sr_Guapo on August 17, 2004 1:28:06 PM]
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
Maybe D3DXCreateCubeTextureFromFile creates a complete mipmap chain?

Have you tried D3DXCreateCubeTextureFromFileEx using a low MipLevels value?

HTH,
Cambo_frog
For the love of god, please tell me that you've just omitted your error checking code for brevity, and you don't really assume that all those functions succeed.
Thanks for your answers!

Sr_guapo: it supports up to 2048x2048 according to caps viewer, so this shouldn't be a problem.

Cambo_frog: do you think so? how could I check that?
Well, when loading a plain texture, I got one with 11 levels, but I think that loading is too fast to have time to resize so large textures. I'll try the ..Ex one!

But my original problem remains, namely why does this card crash instead of dropping the texture.. why doesn't the managed pool do what it should?
------------------------------------------------------------Neo, the Matrix should be 16-byte aligned for better performance!
re: mip levels
Quote:
do you think so? how could I check that?


Try the IDirect3DCubeTexture9::GetLevelCount function

HTH,
Cambo_frog
For the love of god, please tell me that you've just omitted your error checking code for brevity, and you don't really assume that all those functions succeed.

This topic is closed to new replies.

Advertisement