Shaders - add input loader errors for main file
This commit is contained in:
parent
88f1ecfb5d
commit
d53269e09e
1 changed files with 17 additions and 4 deletions
21
shaders.cc
21
shaders.cc
|
@ -157,6 +157,7 @@ void T_InputReader_::handleDirective(
|
||||||
void T_InputReader_::error(
|
void T_InputReader_::error(
|
||||||
__rd__ std::string const& err )
|
__rd__ std::string const& err )
|
||||||
{
|
{
|
||||||
|
printf( "input error (%d - %s)\n" , line , err.c_str( ) );
|
||||||
input.errors.push_back( T_ShaderInputError{
|
input.errors.push_back( T_ShaderInputError{
|
||||||
line , err } );
|
line , err } );
|
||||||
}
|
}
|
||||||
|
@ -323,6 +324,10 @@ struct T_CodeBuilder_
|
||||||
void include( __rd__ std::string const& name ,
|
void include( __rd__ std::string const& name ,
|
||||||
__rd__ const uint32_t lines );
|
__rd__ const uint32_t lines );
|
||||||
void next( );
|
void next( );
|
||||||
|
|
||||||
|
void addInputLoaderErrors(
|
||||||
|
__rd__ T_ShaderInput const* input ,
|
||||||
|
__rd__ std::string const& name );
|
||||||
};
|
};
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
@ -341,6 +346,7 @@ bool T_CodeBuilder_::buildCode( )
|
||||||
} else {
|
} else {
|
||||||
code.type = E_ShaderType( int( main->type ) - 2 );
|
code.type = E_ShaderType( int( main->type ) - 2 );
|
||||||
}
|
}
|
||||||
|
addInputLoaderErrors( main , name );
|
||||||
cname = name;
|
cname = name;
|
||||||
current = main;
|
current = main;
|
||||||
|
|
||||||
|
@ -409,10 +415,7 @@ void T_CodeBuilder_::include(
|
||||||
|
|
||||||
// Add input loader errors
|
// Add input loader errors
|
||||||
if ( libraries.find( nname ) == libraries.end( ) ) {
|
if ( libraries.find( nname ) == libraries.end( ) ) {
|
||||||
for ( auto const& errs : isi->errors ) {
|
addInputLoaderErrors( isi , nname );
|
||||||
code.errors.push_back( T_ShaderError{
|
|
||||||
nname , errs.line , errs.error } );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
libraries.insert( nname );
|
libraries.insert( nname );
|
||||||
|
|
||||||
|
@ -437,6 +440,16 @@ void T_CodeBuilder_::next( )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void T_CodeBuilder_::addInputLoaderErrors(
|
||||||
|
__rd__ T_ShaderInput const* input ,
|
||||||
|
__rd__ std::string const& name )
|
||||||
|
{
|
||||||
|
for ( auto const& errs : input->errors ) {
|
||||||
|
code.errors.push_back( T_ShaderError{
|
||||||
|
name , errs.line , errs.error } );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue