Hi, I am using SlimDX library and I have a strange problem.
I try to add a depth buffer for the MiniTri demo in the SlimDX Open source code but when do that the program shows only a black screen. No triangle is drawn with depth buffer.
I just add this code block after the outputmerger.settarget method line.
Texture2DDescription DepthStencilDescription = new Texture2DDescription();
DepthStencilDescription.Width = desc.ModeDescription.Width;
DepthStencilDescription.Height = desc.ModeDescription.Height;
DepthStencilDescription.MipLevels = 1;
DepthStencilDescription.ArraySize = 1;
DepthStencilDescription.Format = Format.D32_Float;
DepthStencilDescription.SampleDescription = desc.SampleDescription;
DepthStencilDescription.Usage = ResourceUsage.Default;
DepthStencilDescription.BindFlags = BindFlags.DepthStencil;
DepthStencilDescription.CpuAccessFlags = CpuAccessFlags.None;
DepthStencilDescription.OptionFlags = ResourceOptionFlags.None;
Texture2D DepthStencil = new Texture2D(device, DepthStencilDescription);
DepthStencilView DepthStencilView = new DepthStencilView(device, DepthStencil);
device.OutputMerger.SetTargets(DepthStencilView);
every thing stays unchanged in the SlimDX's MiniTri demo and it doesn't draw anymore.
Any ideas ?