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

Function GetPlatform

shadercompiler/ShaderCompiler.cpp:77–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75
76
77Platform GetPlatform( const std::vector<Macro>& defines )
78{
79 if( auto macro = FindMacro( defines, "PLATFORM" ) )
80 {
81 auto platform = ParsePlatform( macro->value.c_str() );
82 if( platform == PLATFORM_INVALID )
83 {
84 printf( "Unrecognized platform define \"%s\". Reverting to dx11\n", macro->value.c_str() );
85 fflush( stdout );
86 return PLATFORM_DX11;
87 }
88 else
89 {
90 return platform;
91 }
92 }
93#if _WIN32
94 return PLATFORM_DX11;
95#else
96 return PLATFORM_METAL;
97#endif
98}
99
100
101struct CompileShaderArguments

Callers 1

CompileShaderFunction · 0.85

Calls 2

FindMacroFunction · 0.85
ParsePlatformFunction · 0.85

Tested by

no test coverage detected