[Bf-blender-cvs] [9b6e86ace13] master: Cycles: stop Metal rendering on command buffer error
Brecht Van Lommel
noreply at git.blender.org
Fri Jun 24 16:52:16 CEST 2022
Commit: 9b6e86ace139529fa18c2e73f960cfa484e199ec
Author: Brecht Van Lommel
Date: Fri Jun 24 15:37:23 2022 +0200
Branches: master
https://developer.blender.org/rB9b6e86ace139529fa18c2e73f960cfa484e199ec
Cycles: stop Metal rendering on command buffer error
If there is an error we should stop rendering, instead of finishing with a
wrong render result or reporting a wrong benchmark time.
Ref T96519
Differential Revision: https://developer.blender.org/D15287
===================================================================
M intern/cycles/device/metal/queue.mm
===================================================================
diff --git a/intern/cycles/device/metal/queue.mm b/intern/cycles/device/metal/queue.mm
index da5408373bb..03e60b6bb6e 100644
--- a/intern/cycles/device/metal/queue.mm
+++ b/intern/cycles/device/metal/queue.mm
@@ -550,7 +550,7 @@ bool MetalDeviceQueue::enqueue(DeviceKernel kernel,
/* Enhanced command buffer errors are only available in 11.0+ */
if (@available(macos 11.0, *)) {
if (command_buffer.status == MTLCommandBufferStatusError && command_buffer.error != nil) {
- printf("CommandBuffer Failed: %s\n", [kernel_name UTF8String]);
+ metal_device_->set_error(string("CommandBuffer Failed: ") + [kernel_name UTF8String]);
NSArray<id<MTLCommandBufferEncoderInfo>> *encoderInfos = [command_buffer.error.userInfo
valueForKey:MTLCommandBufferEncoderInfoErrorKey];
if (encoderInfos != nil) {
@@ -564,7 +564,7 @@ bool MetalDeviceQueue::enqueue(DeviceKernel kernel,
}
}
else if (command_buffer.error) {
- printf("CommandBuffer Failed: %s\n", [kernel_name UTF8String]);
+ metal_device_->set_error(string("CommandBuffer Failed: ") + [kernel_name UTF8String]);
}
}
}];
More information about the Bf-blender-cvs
mailing list