| 1258 | |
| 1259 | |
| 1260 | void 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 | } |
| 1296 | int32_t BindlessTextureType( int type ) |
| 1297 | { |
| 1298 | switch( type ) |
no test coverage detected