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

Method ChangeLocation

shadercompiler/OutputHLSL.cpp:713–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711}
712
713void CompilerInputStream::ChangeLocation( const FileLocation& location )
714{
715 if( m_location.lineNumber != location.lineNumber ||
716 m_location.fileName != location.fileName )
717 {
718 if( m_location.fileName == location.fileName &&
719 m_location.lineNumber + 1 == location.lineNumber )
720 {
721 *this << "\n";
722 }
723 else
724 {
725 std::string fileName = ToString( location.fileName );
726 for( size_t i = 0; i < fileName.length(); ++i )
727 {
728 if( fileName[i] == '\\' )
729 {
730 fileName[i] = '/';
731 }
732 }
733
734 *this << "\n#line " << location.lineNumber << " \"" << fileName << "\"\n";
735 }
736 flush();
737 m_location = location;
738 InlineString pragma;
739 while( m_state.GetPragma( m_location, pragma ) )
740 {
741 *this << "#pragma " << pragma << "\n";
742 m_location.lineNumber++;
743 }
744 }
745}
746
747void CompilerInputStream::Indent()
748{

Callers 1

OutputHLSL.hFile · 0.80

Calls 2

GetPragmaMethod · 0.80
ToStringFunction · 0.70

Tested by

no test coverage detected