MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetResource

Method GetResource

trinity/Shader/Tr2Shader.cpp:111–137  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- 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 --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

109// Pointer to sampler (temporary) or nullptr if the sampler is not found
110// --------------------------------------------------------------------------------------
111const 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:

Callers 15

InitializeMethod · 0.45
OnModifiedMethod · 0.45
SetGrannyResourceMethod · 0.45
InitializeMethod · 0.45
FilterMethod · 0.45
InitializeMethod · 0.45
LoadSecondaryResPathMethod · 0.45
LoadGrannyResMethod · 0.45
InitializeMethod · 0.45
InitializeMethod · 0.45
OnModifiedMethod · 0.45

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected