2014-11-02 2 views
0

안녕하세요. 아주 이상한 문제가 있습니다. 프로그램 처음부터 코드를 단계별로 실행할 때 코드에서 장치 및 스왑 체인을 만들기 위해 섹션의 섹션에 도달하면 Visual Studio가 입력에 대해 지연되기 시작하여 사용할 수 없게됩니다. 나의 마우스는 또한 정말 지연된 응답을 제공합니다. 그것을 막을 수있는 유일한 방법은 Visual Studio를 Ctrl + Alt + Del하고 닫는 것입니다.D3D11 CreateDeviceAndSwapChain을 사용하면 Visual Studio를 사용할 수 없게됩니다.

다음은 해당 라인까지의 코드입니다.

HRESULT hr = S_OK; 

RECT rc; 
GetClientRect((*pWindowHandle), &rc); 
UINT width = rc.right - rc.left; 
UINT height = rc.bottom - rc.top; 

UINT createDeviceFlags = 0; 
#ifdef _DEBUG 
createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; 
#endif 

D3D_DRIVER_TYPE driverTypes[] = 
{ 
    D3D_DRIVER_TYPE_HARDWARE, 
    D3D_DRIVER_TYPE_WARP, 
    D3D_DRIVER_TYPE_REFERENCE, 
}; 
UINT numDriverTypes = ARRAYSIZE(driverTypes); 

D3D_FEATURE_LEVEL featureLevels[] = 
{ 
    D3D_FEATURE_LEVEL_11_0 
}; 
UINT numFeatureLevels = ARRAYSIZE(featureLevels); 

DXGI_SWAP_CHAIN_DESC sd; 
ZeroMemory(&sd, sizeof(sd)); 
sd.BufferCount = 1; 
sd.BufferDesc.Width = width; 
sd.BufferDesc.Height = height; 
sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; 
sd.BufferDesc.RefreshRate.Numerator = 60; 
sd.BufferDesc.RefreshRate.Denominator = 1; 
sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; 
sd.OutputWindow = (*pWindowHandle); 
sd.SampleDesc.Count = 1; 
sd.SampleDesc.Quality = 0; 
sd.Windowed = TRUE; 
sd.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;  // allow full-screen switching 

for (UINT driverTypeIndex = 0; driverTypeIndex < numDriverTypes; driverTypeIndex++) 
{ 
    m_driverType = driverTypes[driverTypeIndex]; 
    hr = D3D11CreateDeviceAndSwapChain(NULL, m_driverType, NULL, createDeviceFlags, featureLevels, numFeatureLevels, 
     D3D11_SDK_VERSION, &sd, &m_pSwapChain, &m_pd3dDevice, &m_featureLevel, &m_pImmediateContext); 
    if (SUCCEEDED(hr)) 
     break; 
} 

D3D11 샘플 프로젝트에서도 동일한 작업을 수행하므로 프로젝트가 아닌 Visual Studio와 관련이있을 수 있습니다. 그들은 잘 실행하지만 당신이 일시 중지하거나 휴식하려고하면 VS는 흔들 거리는 소리를냅니다. VS2013 업데이트 2 버전을 이미 복구하려고 시도했습니다.

저에게 도움이 될만한 것이 있습니까? 디버그 폴더에서

출력

Build started 02/11/2014 16:24:14. 
    1>Project "C:\Users\luckielordie\Source\Repos\3dtut2\Tutorial02_2010.vcxproj" on node 2 (Build target(s)). 
    1>ClCompile: 
     C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /I..\..\..\DXUT11\Core /I..\..\..\DXUT11\Optional /ZI /nologo /W4 /WX- /Od /Oi /Oy- /D WIN32 /D _DEBUG /D DEBUG /D PROFILE /D _WINDOWS /D D3DXFX_LARGEADDRESS_HANDLE /D _UNICODE /D UNICODE /Gm- /EHsc /RTC1 /MDd /GS /arch:SSE2 /fp:fast /Zc:wchar_t /Zc:forScope /openmp- /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt D3D11.cpp 
     D3D11.cpp 
     Link: 
     C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\Users\luckielordie\Source\Repos\3dtut2\Debug\D3DApplication.exe" /INCREMENTAL /NOLOGO d3d11.lib d3dcompiler.lib dxguid.lib winmm.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /manifestinput:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Include\Manifest\dpiaware.manifest" /DEBUG /PDB:"C:\Users\luckielordie\Source\Repos\3dtut2\Debug\D3DApplication.pdb" /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\luckielordie\Source\Repos\3dtut2\Debug\D3DApplication.lib" /MACHINE:X86 /SAFESEH /SAFESEH:NO Debug\Tutorial02.res 
     Debug\D3D11.obj 
     Debug\D3D11ResourceBuilder.obj 
     Debug\Game.obj 
     Debug\GameObject.obj 
     Debug\main.obj 
     Debug\Model.obj 
     Debug\Shader.obj 
     Debug\Window.obj 
     Tutorial02_2010.vcxproj -> C:\Users\luckielordie\Source\Repos\3dtut2\Debug\D3DApplication.exe 
    1>Done Building Project "C:\Users\luckielordie\Source\Repos\3dtut2\Tutorial02_2010.vcxproj" (Build target(s)). 

Build succeeded. 

Time Elapsed 00:00:01.42 

편집 : 나는 정확히 같은 문제를했고,이 비디오 드라이버를 업데이트하여 해결되었다

A thread <threadnumber> has exited with code 0(0x0) 
+0

출력을 VS에서 읽습니다. 그것은 당신을 많이 도울 수 있습니다 – Quest

+0

OP –

+0

에 출력을 추가했습니다. 그런 뜻이 아니 었습니다 ... D3D11_CREATE_DEVICE_DEBUG 플래그가 설정되어 있으므로 출력 창에서 런타임에 유용한 정보가 표시되어야합니다. – Quest

답변

0

라인을 얻을 출력에서 ​​그 라인에 (저는 nVidia GeForce 660을 가지고 있고, 이제 344.75를 사용합니다. "깨끗한"옵션을 사용하여 설치했습니다). 이전 운전 기사는 335 대 였어. 또한 도움이되지 않으면 nVidia ShadowPlay를 사용하지 않도록 설정해보십시오. 그래도 도움이되지는 않았지만 D3D 내부에 키보드 후크가 설치되어 있으면 문제가 있다고 생각합니다.

+0

안녕하세요, 돌아와서 이것을 잊어 버렸습니다. 실제로 저를위한 해결책이 실제로 그림자 놀이를 끄는 것을 발견했습니다! –

관련 문제