Skip to main content
GameDev.net gamedev.net
🔒 Locked

MultiSampleType error

Started by XiotexStudios Jun 8, 2006 at 10:15 AM 0 replies 1.5k views
Original Post
XiotexStudios
XiotexStudios
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:

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


and I immediately create what I think is a multisample type depth stencel:

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


Like I say - this works in release but fails in debug. Any ideas? I am using the April 2006 SDK on an ATI X800
Byron Atkinson-JonesXiotex Studioswww.xiotex.com
XiotexStudios
XiotexStudios
DOH!

one of the other coders was creating a rendertarget and clearing it - using my multisampled depth buffer on a non multisampled RT.

Going away now to shower in bleach.
Byron Atkinson-JonesXiotex Studioswww.xiotex.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.