From c0fb181c56e87ac2ed597fd7f98ae86d88d20575 Mon Sep 17 00:00:00 2001 From: kanglf20 Date: Fri, 3 May 2024 07:46:16 +0800 Subject: [PATCH] Change alias table buffer in PowerLightSampler back to separate buffer object --- src/lightsamplers/power.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lightsamplers/power.cpp b/src/lightsamplers/power.cpp index d9094129..22408898 100644 --- a/src/lightsamplers/power.cpp +++ b/src/lightsamplers/power.cpp @@ -27,10 +27,10 @@ class PowerLightSampler final : public LightSampler { class PowerLightSamplerInstance final : public LightSampler::Instance { private: - BufferView _alias_table_buffer; - BufferView _pdf_buffer; luisa::shared_ptr> _clear_light_power; luisa::shared_ptr> _compute_light_power; + Buffer _alias_table_buffer; + Buffer _pdf_buffer; uint _light_handle_buffer_id{0u}; uint _tag_lut_buffer_id{0u}; float _env_prob{0.f}; @@ -45,10 +45,8 @@ class PowerLightSamplerInstance final : public LightSampler::Instance { _light_handle_buffer_id = light_handle_buffer_id; auto [tag_lut_buffer_view, tag_lut_buffer_id] = pipeline.bindless_arena_buffer(num_inst); _tag_lut_buffer_id = tag_lut_buffer_id; - auto [alias_table_buffer_view, alias_table_buffer_id] = pipeline.bindless_arena_buffer(num_light_inst); - _alias_table_buffer = alias_table_buffer_view; - auto [pdf_buffer_view, pdf_buffer_id] = pipeline.bindless_arena_buffer(num_light_inst); - _pdf_buffer = pdf_buffer_view; + _alias_table_buffer = pipeline.device().create_buffer(num_light_inst); + _pdf_buffer = pipeline.device().create_buffer(num_light_inst); command_buffer << light_handle_buffer_view.copy_from(pipeline.geometry()->light_instances().data()) << commit(); luisa::vector tag_lut(num_inst); for (auto i = 0u; i < num_light_inst; i++) {