diff --git a/intern/cycles/kernel/kernels/opencl/kernel_split.cl b/intern/cycles/kernel/kernels/opencl/kernel_split.cl index 651addb02f4..4cbda1bc2e7 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_split.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_split.cl @@ -14,6 +14,9 @@ * limitations under the License. */ +#include "kernel/kernel_compat_opencl.h" // PRECOMPILED +#include "kernel/split/kernel_split_common.h" // PRECOMPILED + #include "kernel/kernels/opencl/kernel_state_buffer_size.cl" #include "kernel/kernels/opencl/kernel_data_init.cl" #include "kernel/kernels/opencl/kernel_path_init.cl" diff --git a/intern/cycles/util/util_path.cpp b/intern/cycles/util/util_path.cpp index 921a9a8915c..22b407ce926 100644 --- a/intern/cycles/util/util_path.cpp +++ b/intern/cycles/util/util_path.cpp @@ -771,8 +771,10 @@ bool path_remove(const string& path) struct SourceReplaceState { typedef map ProcessedMapping; + string base; ProcessedMapping processed_files; + set precompiled_headers; }; static string line_directive(const SourceReplaceState& state, @@ -811,6 +813,10 @@ static string path_source_replace_includes_recursive( SourceReplaceState::ProcessedMapping::iterator replaced_file = state->processed_files.find(source_filepath); if(replaced_file != state->processed_files.end()) { + if(state->precompiled_headers.find(source_filepath) != + state->precompiled_headers.end()) { + return ""; + } return replaced_file->second; } /* Perform full file processing. */ @@ -827,11 +833,15 @@ static string path_source_replace_includes_recursive( const size_t n_start = 1; const size_t n_end = token.find("\"", n_start); const string filename = token.substr(n_start, n_end - n_start); + const bool is_precompiled = string_endswith(token, "// PRECOMPILED"); string filepath = path_join(state->base, filename); if(!path_exists(filepath)) { filepath = path_join(path_dirname(source_filepath), filename); } + if(is_precompiled) { + state->precompiled_headers.insert(filepath); + } string text; if(path_read_text(filepath, text)) { text = path_source_replace_includes_recursive(