Sign in to follow this  
Meai

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

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
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

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