   Issue with failing depth test
  I'm currently working on a deferred renderer. In order to debug I've set up a system so I can render a single step in the render pipeline.I'm working on the first pass of the deferred renderer (color, normal depth) and going through each of the phases to verify I am retrieving the values. Everything seems to work although I am having some annoying depth test issues.I currently use ID3DX10Font to render my FPS to the screen:font->DrawText(0, output.c_str(), -1, &fontRect, DT_NOCLIP, WHITE);To my knowledge this turns depth clip enable in the raster state to false. Maybe some other things happen behind the scenes that I am unaware of. In any case if I do not reset the raster state after this everything renders "fine". Meaning I see my geometry (the Stanford Buddha scan in this case) although since there is no depth clipping I see faces that should not appear.If I reset the rasterizer after this which should re-enable depth clipping I only see my font.device->OMSetDepthStencilState(0, 0);I have attempted to set the raster state to depthclipenable false originally and then render my geometry but I still fail the depth test for some reason (seen through PIX). I seem to only see my geometry when I draw test and use the DT_NOCLIP flag.Does anyone have a suggestion as to what I may be over looking? I do have a forward renderer which does work.Raster state setup:void DX10Device::SetRasterizer(int32 fm, int32 cm, bool multisample, bool aaline){D3D10_RASTERIZER_DESC rd;rd.FillMode = (D3D10_FILL_MODE)fm;rd.CullMode = (D3D10_CULL_MODE)cm;rd.FrontCounterClockwise = false;rd.DepthBias = 0;rd.DepthBiasClamp = 0;rd.SlopeScaledDepthBias = 0;rd.DepthClipEnable = true;rd.ScissorEnable = false;rd.MultisampleEnable = multisample;rd.AntialiasedLineEnable = aaline;ID3D10RasterizerState* rs;m_device->CreateRasterizerState(&rd, &rs);m_device->RSSetState(rs);}Depth stencil creation:HRESULT Deferred::CreateDebugDepthStencil(){HRESULT hr = S_OK;D3D10_TEXTURE2D_DESC descDepth;memset(&descDepth, 0, sizeof(D3D10_TEXTURE2D_DESC));descDepth.Width = m_width;descDepth.Height = m_height;descDepth.MipLevels = 1;descDepth.ArraySize = 1;descDepth.Format = DXGI_FORMAT_D32_FLOAT;descDepth.SampleDesc.Count = 1;descDepth.SampleDesc.Quality = 0;descDepth.Usage = D3D10_USAGE_DEFAULT;descDepth.BindFlags = D3D10_BIND_DEPTH_STENCIL;descDepth.CPUAccessFlags = 0;descDepth.MiscFlags = 0;hr = m_device->CreateTexture2D(&descDepth, NULL, &m_debugDepthStencilTexture);D3D10_DEPTH_STENCIL_VIEW_DESC descDSV;memset(&descDSV, 0, sizeof(D3D10_DEPTH_STENCIL_VIEW_DESC));descDSV.Format = descDepth.Format;descDSV.ViewDimension = D3D10_DSV_DIMENSION_TEXTURE2D;descDSV.Texture2D.MipSlice = 0;hr = m_device->CreateDepthStencilView(m_debugDepthStencilTexture, &descDSV, &m_debugDepthStencilView);return hr;}Render normal portion of the first pass:rtv is the render target view using the back buffer.debug depth stencil view was setup in the code above.//Set the render target, should not use the depth bufferm_device->OMSetRenderTargets(1, &rtv, m_debugDepthStencilView);//Clear the depth stencilm_device->ClearDepthStencilView(m_depthStencilView, D3D10_CLEAR_DEPTH, 1.0f, 0);//Clear the render target (use pink for debugging)#ifdef _DEBUGm_device->ClearRenderTargetView(rtv, D3DXVECTOR4(1.f, 0.4f, 0.7f, 1.f));#elsem_device->ClearRenderTargetView(rtv, D3DXVECTOR4(0.f, 0.f, 0.f, 1.f));#endifm_device->IASetInputLayout(m_aNDLayout);m_device->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST);m_normalRenderTech->GetPassByIndex(0)->Apply(0);scene->Render(m_ANDWorldMatrixVar, m_ANDViewProjMatrixVar);
  I'm currently uploading a video of the issue to YouTube. I started rotating the geometry in the video and at certain points it looks like I have depth clipping issues and then the rest of the time everything looks fine.I'm thoroughly confused.YouTube video: >link[Edited by - CornyKorn21 on November 22, 2009 11:30:36 PM];  SOLVEDKept over looking that I was clearing the wrong depth stencil view.   