Ogre 1.10, D3D11 device cannot update 2D texture

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Ogre 1.10, D3D11 device cannot update 2D texture

Post by mkultra333 »

Updating program to DX11 on Ogre 1.10. Program works fine in release mode for DX11, and in either release or debug mode for DX9.

However in debug mode with DX11 the following error occurs when the app starts.

Code: Select all

13:51:40: Texture: MtTc_TrimLoSimple.dds: Loading 1 faces(PF_DXT5,1024x512x1) with 8 custom mipmaps from Image. Internal format is PF_DXT5,1024x512x1.
13:51:40: OGRE EXCEPTION(3:RenderingAPIException): D3D11 device cannot update 2D texture
Error Description:ID3D11DeviceContext::UpdateSubresource: Cannot invoke UpdateSubresourceRegion with a DstBox that contains coordinates that are unaligned to a block or byte addressable boundary. *pDstBox = { {left:0, top:0, front:0}, {right:4, bottom:2, back:1} }. BC3_UNORM requires alignment of coodinates to multiples of {4, 4, 1}.
 in D3D11HardwarePixelBuffer::blitFromMemory at C:\Ogre\Ogre_1_10b\RenderSystems\Direct3D11\src\OgreD3D11HardwarePixelBuffer.cpp (line 395)
Debug mode doesn't seem to like this particular .dds file. It loaded others fine though, as shown here:

Code: Select all

13:51:40: Texture: MtTc_WallSimple.dds: Loading 1 faces(PF_DXT5,1024x1024x1) with 8 custom mipmaps from Image. Internal format is PF_DXT5,1024x1024x1.
13:51:40: D3D11: Loading 2D Texture, image name : 'MtTc_WallSimple.dds' with 8 mip map levels
13:51:40: Texture Setup: Set 1, TexNum 113, Image MtTc_WallSimple.dds, Material textures/metaltech/OPAQUE_DSC_MtTc_WallSimple, W1024, H1024
What is the problem? Why is it ok in DX9, or DX11 release, but not DX11 debug?
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: Ogre 1.10, D3D11 device cannot update 2D texture

Post by mkultra333 »

Just thought I'd mention I'm getting this error in debug on a bunch of new .dds textures I've added, but not on others. For example:

Code: Select all

14:10:28: Texture: asteroid.dds: Loading 1 faces(PF_DXT1,256x512x1) with 7 custom mipmaps from Image. Internal format is PF_DXT1,256x512x1.
14:10:28: OGRE EXCEPTION(3:RenderingAPIException): D3D11 device cannot update 2D texture
Error Description:ID3D11DeviceContext::UpdateSubresource: Cannot invoke UpdateSubresourceRegion with a DstBox that contains coordinates that are unaligned to a block or byte addressable boundary. *pDstBox = { {left:0, top:0, front:0}, {right:2, bottom:4, back:1} }. BC1_UNORM requires alignment of coodinates to multiples of {4, 4, 1}.
 in D3D11HardwarePixelBuffer::blitFromMemory at C:\Ogre\Ogre_1_10\RenderSystems\Direct3D11\src\OgreD3D11HardwarePixelBuffer.cpp (line 395)
No error comes up in release mode, or DX9 debug. There seems to be nothing weird about the .dds that won't work, and they are different formats, some have no alpha, some have 1 bit alpha and some have interpolated alpha. They are also different sizes, and some are rectangular. Their materials use different alpha blend modes. Tried compressing them using different programs as well.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: Ogre 1.10, D3D11 device cannot update 2D texture

Post by mkultra333 »

Did some more tests, including carefully loading and rendering each texture in turn. Went and viewed the ones that crashed.

One was not a power of 2 size, it was 600x600. The other four were power of two, but were rectangular rather than square, one was 256x512, the others were 512x256.
When I changed all the textures to power of 2 squares and recompressed them, they worked without problem.

I'm guessing it's related to this error with loading non-power 2 .dds. Except my textures were power 2 (apart from 1) but they weren't square.
http://www.ogre3d.org/forums/viewtopic.php?f=1&t=85586

Edit: Notice there have been some updates to 1.10 since the last time I downloaded it in June, including one involving DXT. Perhaps this is fixed in the latest version.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
Post Reply