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

Function PrintPermutations

shadercompiler/ShaderCompiler.cpp:412–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412bool PrintPermutations( const char* shaderPath )
413{
414 auto shader = g_includeHandler.Open( shaderPath );
415
416 if( !shader )
417 {
418 printf( "%s: error X0000: Could not open input file \"%s\"\n", shaderPath, shaderPath );
419 return false;
420 }
421 g_includeHandler.SetRootPath( shaderPath );
422 g_messages.SetEntryFileName( shaderPath );
423
424 Permutations permutations;
425 if( !DiscoverPermutations( permutations, shader->data, shader->size ) )
426 {
427 g_messages.Flush();
428 return false;
429 }
430
431 for( auto it = permutations.begin(); it != permutations.end(); ++it )
432 {
433 printf( "%s:\n", it->name.c_str() );
434 printf( " options:\n" );
435 for( auto jt = it->options.begin(); jt != it->options.end(); ++jt )
436 {
437 printf( " - name: %s\n", jt->name.c_str() );
438 printf( " value: %i\n", jt->value );
439 }
440 printf( " default: %s\n", it->defaultOption.c_str() );
441 printf( " description: %s\n", it->description.c_str() );
442 }
443 return true;
444}
445
446typedef WorkQueue2<CompileShaderArguments, decltype( &CompileShader )> CompileQueue;
447

Callers 1

mainFunction · 0.85

Calls 7

DiscoverPermutationsFunction · 0.85
OpenMethod · 0.80
SetRootPathMethod · 0.80
SetEntryFileNameMethod · 0.80
FlushMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected