Metal: Fix Device::pendingCommands being freed under us
This commit is contained in:
parent
77a29986b0
commit
a7bfc9d2ac
|
@ -202,6 +202,7 @@ namespace metal {
|
||||||
id<MTLCommandBuffer> Device::GetPendingCommandBuffer() {
|
id<MTLCommandBuffer> Device::GetPendingCommandBuffer() {
|
||||||
if (pendingCommands == nil) {
|
if (pendingCommands == nil) {
|
||||||
pendingCommands = [commandQueue commandBuffer];
|
pendingCommands = [commandQueue commandBuffer];
|
||||||
|
[pendingCommands retain];
|
||||||
}
|
}
|
||||||
return pendingCommands;
|
return pendingCommands;
|
||||||
}
|
}
|
||||||
|
@ -220,6 +221,7 @@ namespace metal {
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[pendingCommands commit];
|
[pendingCommands commit];
|
||||||
|
[pendingCommands release];
|
||||||
pendingCommands = nil;
|
pendingCommands = nil;
|
||||||
pendingCommandSerial ++;
|
pendingCommandSerial ++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue