diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-06-24 16:37:23 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-06-24 17:51:56 +0300 |
commit | 9b6e86ace139529fa18c2e73f960cfa484e199ec (patch) | |
tree | c4a1f6e66e97eebaeb197d0000eef78302f4051d /intern | |
parent | 29755e1df82e34061a0b0586234a5aaac5177d35 (diff) |
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
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/device/metal/queue.mm | 4 |
1 files changed, 2 insertions, 2 deletions
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]); } } }]; |