Original Post
I am getting this error when running our game with debug drivers (works fine in release): Direct3D9: (ERROR) :MultiSampleType between DepthStencil Buffer and RenderTarget must match. First-chance exception at 0x7c81eb33 in bliss.exe: Microsoft C++ exception: long @ 0x0012f9f4. Direct3D9: (ERROR) :Clear failed. my setup code looks like: and I immediately create what I think is a multisample type depth stencel: Like I say - this works in release but fails in debug. Any ideas? I am using the April 2006 SDK on an ATI X800
d3dpp.BackBufferWidth = vid_mode.m_dwCreationWidth;
d3dpp.BackBufferHeight = vid_mode.m_dwCreationHeight;
d3dpp.BackBufferFormat = vid_mode.m_dwFormat;
d3dpp.BackBufferCount = vid_mode.m_dwBackBuffer_Count;
d3dpp.MultiSampleType = D3DMULTISAMPLE_4_SAMPLES;// D3DMULTISAMPLE_NONE;//D3DMULTISAMPLE_4_SAMPLES;//vid_mode.m_Adapters[adapter].devices[device].MultiSampleType;
d3dpp.SwapEffect = vid_mode.m_dwSwapEffect;
d3dpp.hDeviceWindow = winhwnd;
d3dpp.Windowed = vid_mode.m_Adapters[adapter].devices[device].bWindowed;
d3dpp.EnableAutoDepthStencil = FALSE;
d3dpp.Flags = vid_mode.m_dwFlags;
d3dpp.FullScreen_RefreshRateInHz = vid_mode.m_dw_CreationRefreshRate;
d3dpp.PresentationInterval = vid_mode.m_dwPresentationInterval;
RENDER_WinWidth = vid_mode.m_dwCreationWidth;
RENDER_WinHeight = vid_mode.m_dwCreationHeight;
if(FAILED(g_pD3D->CreateDevice(adapter,vid_mode.m_Adapters[adapter].devices[device].DeviceType,winhwnd,vid_mode.m_dwBehavior,&d3dpp,&g_pd3dDevice))) return E_FAIL;
g_pd3dDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS,TRUE);
if(FAILED(g_pd3dDevice->CreateDepthStencilSurface(vid_mode.m_dwCreationWidth,vid_mode.m_dwCreationHeight,D3DFMT_D16,D3DMULTISAMPLE_4_SAMPLES,0,FALSE,&depth_buffer,NULL)))
{
return E_FAIL;
}
g_pd3dDevice->SetDepthStencilSurface(depth_buffer);