Sign in to follow this  

[SlimDX]2x2 surface problem

This topic is 2632 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

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

This topic is 2632 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this