Original Post
I am learning D3D10 now, and i want to create a demo without DXUT or Effect system, so i need to set the global variables manually, but when i am using D3DX10CompileFromFile to compile MyTest_VS.vsh but it is failing with E_FAIL. The code I'm using is as follows: DWORD dwShaderFlags = 0; dwShaderFlags |= D3D10_SHADER_DEBUG; ID3D10Blob* pVSBuf = NULL; ID3D10Blob* pErrorMsg = NULL; hr = D3DX10CompileFromFile( L"MyTest_VS.vsh", NULL, NULL, "VS", "vs_4_0", dwShaderFlags, NULL, NULL, &pVSBuf, &pErrorMsg, NULL ) ; if( FAILED( hr )) return hr; and i have setup the device with the Device creation flags like this: createDeviceFlags = D3D10_CREATE_DEVICE_DEBUG; D3D10CreateDeviceAndSwapChain( NULL, g_driverType, NULL, createDeviceFlags, D3D10_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice ); Anybody can give me some information about this error?? thx!