Skip to content

Commit 2ee1ca1

Browse files
committed
Reuse id<MTL4CommandBuffer>
1 parent a43fbcc commit 2ee1ca1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/FlyCube/CommandList/MTCommandList.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ MTLStages ResourceStateToMTLStages(ResourceState state)
155155
} else {
156156
[allocator_ reset];
157157
}
158-
command_buffer_ = [device_.GetDevice() newCommandBuffer];
158+
if (!command_buffer_) {
159+
command_buffer_ = [device_.GetDevice() newCommandBuffer];
160+
}
159161
[command_buffer_ beginCommandBufferWithAllocator:allocator_];
160162

161163
state_ = std::make_unique<State>();

0 commit comments

Comments
 (0)