Changeset 2354 for OGRE/trunk/ogre_changes
- Timestamp:
- 05/08/07 14:36:28 (18 years ago)
- Location:
- OGRE/trunk/ogre_changes/Ogre1.2/RenderSystems/Direct3D9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
OGRE/trunk/ogre_changes/Ogre1.2/RenderSystems/Direct3D9/include/OgreD3D9HLSLProgram.h
r1728 r2354 80 80 static CmdOptimalization msCmdOptimalization; 81 81 static CmdFlowControl msCmdFlowControl; 82 83 /** Internal load implementation, loads just the high-level portion, enough to 84 get parameters. 85 */ 86 void loadHighLevelImpl(void); 87 virtual void loadFromFile(void); 82 88 #endif 83 89 /** Internal load implementation, must be implemented by subclasses. 84 90 */ 85 91 void loadFromSource(void); 86 92 /** Internal method for creating an appropriate low-level program from this 87 93 high-level program, must be implemented by subclasses. */ 88 94 void createLowLevelImpl(void); -
OGRE/trunk/ogre_changes/Ogre1.2/RenderSystems/Direct3D9/src/OgreD3D9HLSLProgram.cpp
r1728 r2354 92 92 93 93 94 } 94 } 95 #ifdef GAMETOOLS_ILLUMINATION_MODULE 96 //----------------------------------------------------------------------- 97 void D3D9HLSLProgram::loadHighLevelImpl(void) 98 { 99 if (mLoadFromFile) 100 loadFromFile(); 101 else 102 loadFromSource(); 103 } 104 void D3D9HLSLProgram::loadFromFile(void) 105 { 106 LPD3DXBUFFER errors = 0; 107 108 mCompilerFlags = NULL; 109 110 if(!mOptimalization) 111 mCompilerFlags = D3DXSHADER_SKIPOPTIMIZATION; 112 if(mFlowControl == 1) 113 mCompilerFlags = mCompilerFlags|D3DXSHADER_PREFER_FLOW_CONTROL; 114 if(mFlowControl == -1) 115 mCompilerFlags = mCompilerFlags|D3DXSHADER_AVOID_FLOW_CONTROL; 116 117 HRESULT hr = D3DXCompileShaderFromFile( 118 mFilename.c_str(), 119 NULL, //no preprocessor defines 120 NULL, //no includes 121 mEntryPoint.c_str(), 122 mTarget.c_str(), 123 mCompilerFlags, 124 &mpMicroCode, 125 &errors, 126 &mpConstTable); 127 128 if (FAILED(hr)) 129 { 130 String message = "Cannot assemble D3D9 high-level shader " + mName + " Errors:\n" + 131 static_cast<const char*>(errors->GetBufferPointer()); 132 errors->Release(); 133 OGRE_EXCEPT(hr, message, 134 "D3D9HLSLProgram::loadFromSource"); 135 } 136 } 137 #endif 95 138 //----------------------------------------------------------------------- 96 139 void D3D9HLSLProgram::createLowLevelImpl(void)
Note: See TracChangeset
for help on using the changeset viewer.