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

Function MergeSamplers

shadercompiler/TextureFunctionConversionDX11.cpp:1260–1295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1258
1259
1260void MergeSamplers( ParserState& state )
1261{
1262 std::map<Sampler, Symbol*> samplers;
1263
1264 for( auto child : state.GetTree()->GetChildren() )
1265 {
1266 if( child->GetNodeType() == NT_VAR_DECLARATION_LIST )
1267 {
1268 for( auto name : child->GetChildren() )
1269 {
1270 if( name && name->GetSymbol() && name->GetSymbol()->type.IsSampler() )
1271 {
1272 Sampler sampler;
1273 if( GetSamplerState( state, name, sampler ) && !sampler.isDynamic )
1274 {
1275 auto found = samplers.find( sampler );
1276 if( found != samplers.end() )
1277 {
1278 state.GetTree()->Map( [&]( auto node ) {
1279 if( node->GetNodeType() != NT_NAME_DECLARATION && node->GetSymbol() == name->GetSymbol() )
1280 {
1281 node->SetSymbol( found->second );
1282 }
1283 return node;
1284 } );
1285 }
1286 else
1287 {
1288 samplers[sampler] = name->GetSymbol();
1289 }
1290 }
1291 }
1292 }
1293 }
1294 }
1295}
1296int32_t BindlessTextureType( int type )
1297{
1298 switch( type )

Callers 1

CompileEffectMethod · 0.85

Calls 8

GetSamplerStateFunction · 0.85
GetTreeMethod · 0.80
GetNodeTypeMethod · 0.80
GetSymbolMethod · 0.80
IsSamplerMethod · 0.80
SetSymbolMethod · 0.80
endMethod · 0.45
MapMethod · 0.45

Tested by

no test coverage detected