@@ -70,14 +70,14 @@ namespace nbl::asset::hlsl::impl
70
70
BOOST_WAVE_THROW_CTX (iter_ctx.ctx , boost::wave::preprocess_exception,
71
71
bad_include_file, iter_ctx.filename .c_str (), act_pos);
72
72
auto & res_str = *result;
73
- iter_ctx.instring = res_str + " \n " ;
73
+ iter_ctx.instring = res_str;
74
74
}
75
75
else // include finder not provided
76
76
{
77
77
auto builtin_pair = nbl::builtin::get_resource_runtime (filepath);
78
78
if (builtin_pair.first ) // builtin exists
79
79
{
80
- iter_ctx.instring = std::string (builtin_pair.first , builtin_pair.first + builtin_pair.second ) + " \n " ;
80
+ iter_ctx.instring = std::string (builtin_pair.first , builtin_pair.first + builtin_pair.second );
81
81
}
82
82
else // default boost behavior
83
83
{
@@ -328,7 +328,8 @@ std::string CHLSLCompiler::preprocessShader(std::string&& code, IShader::E_SHADE
328
328
hlsl::impl::custom_preprocessing_hooks hooks (preprocessOptions, stage);
329
329
std::string startingFileIdentifier = std::string (" ../" ) + preprocessOptions.sourceIdentifier .data ();
330
330
wave_context_t context (code.begin (), code.end (), startingFileIdentifier.data (), hooks);
331
- context.set_language (boost::wave::support_cpp20);
331
+ auto language = boost::wave::support_cpp20 | boost::wave::support_option_preserve_comments | boost::wave::support_option_emit_line_directives;
332
+ context.set_language (static_cast <boost::wave::language_support>(language));
332
333
context.add_macro_definition (" __HLSL_VERSION" );
333
334
// TODO fix bad syntax and uncomment
334
335
// instead of defining extraDefines as "NBL_GLSL_LIMIT_MAX_IMAGE_DIMENSION_1D 32768",
0 commit comments