-------------------------------------------------------------------------------------- Description: Searches for a sampler by its texture name. Arguments: name - Texture name. Return value: Pointer to sampler (temporary) or nullptr if the sampler is not found --------------------------------------------------------------------------------------
| 109 | // Pointer to sampler (temporary) or nullptr if the sampler is not found |
| 110 | // -------------------------------------------------------------------------------------- |
| 111 | const Tr2EffectResource* Tr2Shader::GetResource( const char* name ) const |
| 112 | { |
| 113 | for( auto t = m_effect.techniques.begin(); t != m_effect.techniques.end(); ++t ) |
| 114 | { |
| 115 | for( auto pass = t->passes.begin(); pass != t->passes.end(); ++pass ) |
| 116 | { |
| 117 | for( unsigned i = 0; i < Tr2RenderContextEnum::SHADER_TYPE_COUNT; ++i ) |
| 118 | { |
| 119 | for( auto constant = pass->stageInputs[i].resources.begin(); constant != pass->stageInputs[i].resources.end(); ++constant ) |
| 120 | { |
| 121 | if( strcmp( constant->second.name, name ) == 0 ) |
| 122 | { |
| 123 | return &constant->second; |
| 124 | } |
| 125 | } |
| 126 | for( auto constant = pass->stageInputs[i].uavs.begin(); constant != pass->stageInputs[i].uavs.end(); ++constant ) |
| 127 | { |
| 128 | if( strcmp( constant->second.name, name ) == 0 ) |
| 129 | { |
| 130 | return &constant->second; |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | return nullptr; |
| 137 | } |
| 138 | |
| 139 | // -------------------------------------------------------------------------------------- |
| 140 | // Description: |
no test coverage detected