DirectX problems with more than one +4096 textures?

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
vilgeits
Goblin
Posts: 298
Joined: Tue Aug 02, 2005 10:41 pm

DirectX problems with more than one +4096 textures?

Post by vilgeits »

I'm working on a composition system that needs to work on large images.

Mostly are under that 4096 but some times supersampling is needed so if you want to use a 3000 px image you are really using a 6000px one. I noticed that I need to disable mip generation to avoid to go over 8192, and it is loaded without problems.

My real problem is that loading more than one texture of this sizes the app crashes with any useful information in the log file

Code: Select all

Ogre::TexturePtr mTptr =Ogre::TextureManager::getSingleton().load(s[0],Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,Ogre::TEX_TYPE_2D,0);
Ogre::LogManager::getSingletonPtr()->logMessage("FIRST LOADING");
while (!mTptr->isLoaded()){}
Ogre::LogManager::getSingletonPtr()->logMessage("FIRST LOADED");

mTptr =Ogre::TextureManager::getSingleton().load(s[1],Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,Ogre::TEX_TYPE_2D,0);
Ogre::LogManager::getSingletonPtr()->logMessage("SECOND LOADING");
while (!mTptr->isLoaded()){}
Ogre::LogManager::getSingletonPtr()->logMessage("SECOND LOADED");
The trace writes "FIRST LOADING" & "FIRST LOADED" but nothing about the second, also I swap s[0] and s[1] it works fine for the first or if I load two times the same tex (s[0] or s[1]) it runs the app.

More info:
SO: Win 7 64 bit
GPU: 8800 GT
OGRE v. 1.8
System: Directx + fixed pipeline (PS3.0).

Thanks in advance!
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: DirectX problems with more than one +4096 textures?

Post by Kojack »

A 6000x6000 image will most likely be padded up to 8192x8192 (padding is different on different chipsets, I had a texture 320 wide, an ati card padded it to 384 and a nvidia card padded it to 512).
8192x8192 (assuming 32 bit colour) takes 256MB of ram.
The standard memory size of a geforce 8800gt is 512MB. Once you've got various buffers on there (back, depth, vertex, index, etc) you've got room for only 1 of those big textures.

Even a 4096x4096 texture is going to take up 64MB, so only 7 of them could fit in video memory.
User avatar
vilgeits
Goblin
Posts: 298
Joined: Tue Aug 02, 2005 10:41 pm

Re: DirectX problems with more than one +4096 textures?

Post by vilgeits »

Kojack wrote:A 6000x6000 image will most likely be padded up to 8192x8192 (padding is different on different chipsets, I had a texture 320 wide, an ati card padded it to 384 and a nvidia card padded it to 512).
8192x8192 (assuming 32 bit colour) takes 256MB of ram.
The standard memory size of a geforce 8800gt is 512MB. Once you've got various buffers on there (back, depth, vertex, index, etc) you've got room for only 1 of those big textures.

Even a 4096x4096 texture is going to take up 64MB, so only 7 of them could fit in video memory.
The weird thing is that no error is shown (with other test a "not enough memory" has been shown).

PS. I forget to say that the same crash happens under a 9600GT (1Gb)
User avatar
vilgeits
Goblin
Posts: 298
Joined: Tue Aug 02, 2005 10:41 pm

Re: DirectX problems with more than one +4096 textures?

Post by vilgeits »

14:20:26: Texture: TEXFIRST.exr: Loading 1 faces(PF_FLOAT32_RGB,6000x3000x1) with 0 generated mipmaps from Image. Internal format is PF_FLOAT32_RGBA,6000x3000x1.
14:20:27: FIRST LOADING
14:20:27: FIRST LOADED
14:20:30: Texture: TEXSECOND.exr: Loading 1 faces(PF_FLOAT32_RGB,6000x3000x1) with 0 generated mipmaps from Image. Internal format is PF_FLOAT32_RGBA,6000x3000x1.
And crashes without more logging or message.

No memory error here.
User avatar
vilgeits
Goblin
Posts: 298
Joined: Tue Aug 02, 2005 10:41 pm

Re: DirectX problems with more than one +4096 textures?

Post by vilgeits »

If I try to load .jpg's instead .exr (8bit instead 32bit) it works fine but I repeat is not a memory issue, also it crashes at same point if I use 16 bit per channel.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: DirectX problems with more than one +4096 textures?

Post by Kojack »

Wait, you were loading floating point textures? Multiply all my memory usages by 4.
A 4096x4096 now takes 256MB.
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: DirectX problems with more than one +4096 textures?

Post by mkultra333 »

Shader model 3.0 requires cards support 4096x4096 textures, but I don't know that every card will support higher than that if they don't need to.

Regarding memory, if you can dxt3 the texture then it'll only be about 1/6th the memory footprint (1/8th if you get rid of the mipmaps).
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
Post Reply