Skip to content

Commit a452949

Browse files
committed
Do not remove patch_buffers at MTCommandList::Close
1 parent 2ee1ca1 commit a452949

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/FlyCube/CommandList/MTCommandList.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class MTCommandList : public CommandList {
123123
MTDevice& device_;
124124
id<MTL4CommandAllocator> allocator_ = nullptr;
125125
id<MTL4CommandBuffer> command_buffer_ = nullptr;
126+
std::vector<id<MTLBuffer>> patch_buffers_;
126127

127128
static constexpr MTLStages kRenderStages = MTLStageVertex | MTLStageObject | MTLStageMesh | MTLStageFragment;
128129
static constexpr MTLStages kComputeStages = MTLStageDispatch | MTLStageBlit | MTLStageAccelerationStructure;
@@ -143,7 +144,6 @@ class MTCommandList : public CommandList {
143144
std::shared_ptr<MTBindingSet> binding_set;
144145
std::map<ShaderType, id<MTL4ArgumentTable>> argument_tables;
145146
id<MTLResidencySet> residency_set = nullptr;
146-
std::vector<id<MTLBuffer>> patch_buffers;
147147
bool need_apply_pipeline = false;
148148
bool need_apply_binding_set = false;
149149
MTLStages render_barrier_after_stages = MTLStageAll;

src/FlyCube/CommandList/MTCommandList.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ MTLStages ResourceStateToMTLStages(ResourceState state)
597597
acceleration_structure_desc.instanceDescriptorBuffer =
598598
MTL4BufferRangeMake(patched_instance_data.gpuAddress, patched_instance_data.length);
599599
acceleration_structure_desc.instanceDescriptorType = MTLAccelerationStructureInstanceDescriptorTypeIndirect;
600-
state_->patch_buffers.push_back(patched_instance_data);
600+
patch_buffers_.push_back(patched_instance_data);
601601

602602
decltype(auto) mt_dst = dst->As<MTResource>();
603603
decltype(auto) mt_scratch = scratch->As<MTResource>();

0 commit comments

Comments
 (0)