| 67 | } |
| 68 | |
| 69 | bool CD3DX10Module::LoadModule(LPCTSTR lpModuleName) |
| 70 | { |
| 71 | // it is complicated to support ReflectShader call since DX SDK August 08, |
| 72 | // for now we will disable it. |
| 73 | |
| 74 | if (__super::LoadModule(lpModuleName)) |
| 75 | { |
| 76 | m_pD3DXCheckVersion = (D3DXCheckVersionProc)GetProcAddress("D3DXCheckVersion"); |
| 77 | m_pD3DX10CompileFromMemory = (D3DX10CompileFromMemoryProc)GetProcAddress("D3DX10CompileFromMemory"); |
| 78 | m_pD3DX10DisassembleShader = (D3DX10DisassembleShaderProc)GetProcAddress("D3DX10DisassembleShader"); |
| 79 | // m_pD3DX10ReflectShader = (D3DX10ReflectShaderProc) GetProcAddress("D3DX10ReflectShader"); |
| 80 | |
| 81 | if (!m_pD3DX10CompileFromMemory || !m_pD3DX10DisassembleShader /*|| !m_pD3DX10ReflectShader */) |
| 82 | { |
| 83 | LPCSTR lpCompilerModuleName = _T(""); |
| 84 | |
| 85 | if (lstrcmpi(lpModuleName, _T("D3DX10_41.DLL")) == 0) |
| 86 | { |
| 87 | lpCompilerModuleName = _T("D3DCompiler_41.dll"); |
| 88 | } |
| 89 | else if (lstrcmpi(lpModuleName, _T("D3DX10_40.DLL")) == 0) |
| 90 | { |
| 91 | lpCompilerModuleName = _T("D3DCompiler_40.dll"); |
| 92 | } |
| 93 | |
| 94 | if (lstrcmpi(lpModuleName, _T("")) != 0) |
| 95 | { |
| 96 | if (m_pCompileModule == NULL) |
| 97 | { |
| 98 | m_pCompileModule = new CModule(lpCompilerModuleName); |
| 99 | } |
| 100 | |
| 101 | if (!m_pD3DX10DisassembleShader) |
| 102 | { |
| 103 | m_pD3DX10DisassembleShader = (D3DX10DisassembleShaderProc)m_pCompileModule->GetProcAddress("D3DDisassemble"); |
| 104 | } |
| 105 | |
| 106 | // if ( !m_pD3DX10ReflectShader ) |
| 107 | // { |
| 108 | // m_pD3DX10ReflectShader = (D3DX10ReflectShaderProc) m_pCompileModule->GetProcAddress("D3DReflect"); |
| 109 | // } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | if (/*!m_pD3DXCheckVersion || */ !m_pD3DX10CompileFromMemory || !m_pD3DX10DisassembleShader /*|| !m_pD3DX10ReflectShader*/) |
| 114 | { |
| 115 | UnloadModule(); |
| 116 | return false; |
| 117 | } |
| 118 | else |
| 119 | return true; |
| 120 | } |
| 121 | else |
| 122 | return false; |
| 123 | } |
| 124 | |
| 125 | void CD3DX10Module::UnloadModule() |
| 126 | { |
no test coverage detected