diff --git a/src/base/integrator.h b/src/base/integrator.h index 631c41c4..be446c9e 100644 --- a/src/base/integrator.h +++ b/src/base/integrator.h @@ -112,8 +112,8 @@ class DifferentiableIntegrator : public Integrator { }; private: - luisa::unique_ptr _loss; - luisa::unique_ptr _optimizer; + const Loss *_loss; + const Optimizer *_optimizer; uint _iterations; int _display_camera_index; bool _save_process; @@ -122,8 +122,8 @@ class DifferentiableIntegrator : public Integrator { DifferentiableIntegrator(Scene *scene, const SceneNodeDesc *desc) noexcept; [[nodiscard]] bool is_differentiable() const noexcept override { return true; } - [[nodiscard]] auto loss() const noexcept { return _loss.get(); } - [[nodiscard]] auto optimizer() const noexcept { return _optimizer.get(); } + [[nodiscard]] auto loss() const noexcept { return _loss; } + [[nodiscard]] auto optimizer() const noexcept { return _optimizer; } [[nodiscard]] auto iterations() const noexcept { return _iterations; } [[nodiscard]] int display_camera_index() const noexcept { return _display_camera_index; } [[nodiscard]] bool save_process() const noexcept { return _save_process; } diff --git a/src/textures/constant.cpp b/src/textures/constant.cpp index f5a02e21..1cc9d92b 100644 --- a/src/textures/constant.cpp +++ b/src/textures/constant.cpp @@ -68,7 +68,6 @@ class ConstantTextureInstance final : public Texture::Instance { CommandBuffer &cmd_buffer, luisa::optional param) noexcept : Texture::Instance{p, t}, _diff_param{std::move(param)} { - LUISA_INFO("index {} prepared.", _diff_param->index()); if (!t->should_inline()) { auto [buffer, buffer_id] = p.allocate_constant_slot(); auto v = t->v(); @@ -104,8 +103,8 @@ class ConstantTextureInstance final : public Texture::Instance { Expr, Expr grad) const noexcept override { if (_diff_param) { $if(_diff_param->index() != 0u) { - device_log("ggggggggg ({}) , grad in accumulate: ({}, {}, {})", - _diff_param->index(), grad[0u], grad[1u], grad[2u]); + // device_log("ggggggggg ({}) , grad in accumulate: ({}, {}, {})", + // _diff_param->index(), grad[0u], grad[1u], grad[2u]); }; auto slot_seed = xxhash32(as(it.p())); // $if(_diff_param->index() == 1u) {