@@ -24,7 +24,6 @@ void ff_metal_compute_encoder_dispatch(id<MTLDevice> device,
id<MTLComputeCommandEncoder> encoder,
NSUInteger width, NSUInteger height)
{
- BOOL fallback = YES;
MTLSize threadsPerThreadgroup;
NSUInteger w, h;
@@ -39,11 +38,13 @@ void ff_metal_compute_encoder_dispatch(id<MTLDevice> device,
if ([device supportsFamily:MTLGPUFamilyCommon3]) {
MTLSize threadsPerGrid = MTLSizeMake(width, height, 1);
[encoder dispatchThreads:threadsPerGrid threadsPerThreadgroup:threadsPerThreadgroup];
- fallback = NO;
+ return;
}
}
#endif
- if (fallback) {
+
+ // Fallback path, if we took the above one we already returned so none of this is reached
+ {
MTLSize threadgroups = MTLSizeMake((width + w - 1) / w,
(height + h - 1) / h,
1);