@@ -1002,6 +1002,7 @@ inline void wait(Context &ctx, std::future<void> &future) {
1002
1002
inline void toCPU (Context &ctx, Tensor &tensor, void *data, size_t bufferSize,
1003
1003
CopyData &op) {
1004
1004
wgpuQueueSubmit (ctx.queue , 1 , &op.commandBuffer );
1005
+ wgpuCommandBufferRelease (op.commandBuffer );
1005
1006
CallbackData callbackData = {op.readbackBuffer , bufferSize, data, &op.promise ,
1006
1007
&op.future };
1007
1008
wgpuQueueOnSubmittedWorkDone (
@@ -1109,6 +1110,7 @@ inline void toCPU(Context &ctx, WGPUBuffer buffer, void *data,
1109
1110
check (op.commandBuffer , " Create command buffer" , __FILE__, __LINE__);
1110
1111
}
1111
1112
wgpuQueueSubmit (ctx.queue , 1 , &op.commandBuffer );
1113
+ wgpuCommandBufferRelease (op.commandBuffer );
1112
1114
CallbackData callbackData = {op.readbackBuffer , bufferSize, data, &op.promise ,
1113
1115
&op.future };
1114
1116
wgpuQueueOnSubmittedWorkDone (
@@ -1513,6 +1515,7 @@ inline void dispatchKernel(Context &ctx, Kernel &kernel,
1513
1515
resetCommandBuffer (ctx.device , kernel);
1514
1516
}
1515
1517
wgpuQueueSubmit (ctx.queue , 1 , &kernel->commandBuffer );
1518
+ wgpuCommandBufferRelease (kernel->commandBuffer );
1516
1519
kernel->used = true ;
1517
1520
wgpuQueueOnSubmittedWorkDone (
1518
1521
ctx.queue ,
0 commit comments