From 1af8233590ee7e2f6934b0089f835409567fc043 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 29 Nov 2022 01:24:13 +0100 Subject: [PATCH] Adapt Dr.Jit to Dr.Jit-Core code generation This PR makes Dr.Jit compatible with the following Dr.Jit-Core PRs: - https://github.com/mitsuba-renderer/drjit-core/pull/40 - https://github.com/mitsuba-renderer/drjit-core/pull/41 --- ext/drjit-core | 2 +- include/drjit/loop.h | 4 ---- include/drjit/vcall_jit_record.h | 3 ++- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ext/drjit-core b/ext/drjit-core index b00ccd161..51d54c0e8 160000 --- a/ext/drjit-core +++ b/ext/drjit-core @@ -1 +1 @@ -Subproject commit b00ccd16141bb7f5cf7d74e7e83c5c603fb760e8 +Subproject commit 51d54c0e8c954a1acc08cd44e05257d080a56969 diff --git a/include/drjit/loop.h b/include/drjit/loop.h index 56fb974e7..8dbe8ebf5 100644 --- a/include/drjit/loop.h +++ b/include/drjit/loop.h @@ -172,9 +172,6 @@ struct Loop> { if (!m_record) return; - // Capture JIT state and begin recording session - m_jit_state.new_scope(); - // Rewrite loop state variables (1) m_loop_init = jit_var_loop_init(m_indices.size(), m_indices.data()); @@ -299,7 +296,6 @@ struct Loop> { m_indices_prev.clear(); m_jit_state.end_recording(); - m_jit_state.clear_scope(); m_jit_state.clear_mask_if_set(); jit_var_mark_side_effect(rv); diff --git a/include/drjit/vcall_jit_record.h b/include/drjit/vcall_jit_record.h index 13cecb26d..527a42f7d 100644 --- a/include/drjit/vcall_jit_record.h +++ b/include/drjit/vcall_jit_record.h @@ -96,7 +96,6 @@ Result vcall_jit_record_impl(const char *name, uint32_t n_inst, detail::JitState jit_state; jit_state.begin_recording(); - jit_state.new_scope(); state[0] = jit_record_checkpoint(Backend); @@ -156,6 +155,7 @@ Result vcall_jit_record_impl(const char *name, uint32_t n_inst, jit_state.end_recording(); jit_var_mark_side_effect(se); + jit_new_scope(Backend); if constexpr (!std::is_same_v) { Result result; @@ -236,6 +236,7 @@ Result vcall_jit_record(const char *name, const Func &func, Self &self, std::make_index_sequence(), args...); } else { isolate_grad guard; + jit_new_scope(Backend); return vcall_jit_record_impl( name, n_inst, func, self, mask,