Jump to content
  • Advertisement
Sign in to follow this  
jor1980

[SlimDX]2x2 surface problem

This topic is 2827 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi i am creating surfaces with this code :

output = new SlimDX.Direct3D9.Texture(myDevice, mipWidth, mipHeight, 1, SlimDX.Direct3D9.Usage.None,formatoImagen, SlimDX.Direct3D9.Pool.SystemMemory);

it works, but when the surface is 2x2 dimensions it crashes, the dxt format i use is dxt1

Share this post


Link to post
Share on other sites
Advertisement
Compressed surface formats must be at least 4x4, since the DXT compression works on 4x4 texel blocks.

if it crashes, that means you're not doing error checking correctly (I.e. not catching the exception).

Share this post


Link to post
Share on other sites

I'm gonna take a guess that it has something to do with DXT compression operating on 4x4 blocks as detailed here. If that's correct, you might want to use a larger surface of at least 4x4 or forego DXT compression for 2x2 surfaces, which might be a bit small to justify compression anyway. Edit - beaten to it again, must type faster [smile]

Share this post


Link to post
Share on other sites
From the documentation (MSDN seems to be down for me?), D3DFORMAT -> DXTn Compressed Texture Formats:
Quote:
The runtime will not allow an application to create a surface using a DXTn format unless the surface dimensions are multiples of 4. This applies to offscreen-plain surfaces, render targets, 2D textures, cube textures, and volume textures.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!