Jump to content
  • Advertisement
Sign in to follow this  
Meai

[SlimDX] Problem creating textures with a Texture2DDescription/Debug Info

This topic is 3057 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 slowly get the hang of SlimDX, but I encountered a strange problem while creating textures from Texture2DDescription. I cannot work around it, because I need to manually write into my textures. Here is the error message I get:
Quote:
E_INVALIDARG: An invalid parameter was passed to the returning function (-2147024809) SlimDX.Direct3D10.Direct3D10Exception: E_INVALIDARG: An invalid parameter was passed to the returning function (-2147024809)
From: "Filling textures manually" http://msdn.microsoft.com/en-us/library/ee415734(VS.85).aspx translated to c#/slimdx:
Quote:
Texture2DDescription desc2 = new Texture2DDescription(); desc2.Width = 256; desc2.Height = 256; desc2.MipLevels = 1; desc2.ArraySize = 1; desc2.Format = SlimDX.DXGI.Format.R8G8B8A8_UNorm; desc2.Usage = ResourceUsage.Dynamic; desc2.BindFlags = BindFlags.ShaderResource; desc2.CpuAccessFlags = CpuAccessFlags.Write; texture = new Texture2D(device, desc2); // THE ERROR HAPPENS HERE
MAIN PROBLEM I GUESS: I have enabled unmanaged debugging in the project settings / debug tab, and I have created my device with the '.Debug' flag. There is no more information about this error in Visual Studio! I THEN decided to use PIX, and I get this error:
Quote:
D3D10: ERROR: ID3D10Device::CreateTexture2D: The Sample descriptor is invalid. DXGI_SAMPLE_DESC::Count should be greater than zero [ STATE_CREATION ERROR #93: CREATETEXTURE2D_INVALIDSAMPLES ]
Why do I not get this in Visual Studio? And what does it mean? I do not have a property called "Sample descriptor". This is something I cannot figure out for myself, please help :(

Share this post


Link to post
Share on other sites
Advertisement
Do you know how to enable these more descriptive error messages in Visual Studio?

Thanks already though

Share this post


Link to post
Share on other sites
Open the DX control panel, add your .exe path to the debug list for directx 10/11.

In VS, go to the properties of your app and Enable unmanaged code debugging.
All the DX info/warnings/errors will be output to the Output window when the debugger is attached.

I can't remember if you need to pass in the debug flag when creating the device to receive these messages or not, meh, just pass it in anyway :P

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!