@@ -24,11 +24,15 @@ void ff_metal_compute_encoder_dispatch(id<MTLDevice> device,
id<MTLComputeCommandEncoder> encoder,
NSUInteger width, NSUInteger height)
{
- [encoder setComputePipelineState:pipeline];
- NSUInteger w = pipeline.threadExecutionWidth;
- NSUInteger h = pipeline.maxTotalThreadsPerThreadgroup / w;
- MTLSize threadsPerThreadgroup = MTLSizeMake(w, h, 1);
BOOL fallback = YES;
+ MTLSize threadsPerThreadgroup;
+ NSUInteger w, h;
+
+ [encoder setComputePipelineState:pipeline];
+ w = pipeline.threadExecutionWidth;
+ h = pipeline.maxTotalThreadsPerThreadgroup / w;
+ threadsPerThreadgroup = MTLSizeMake(w, h, 1);
+
// MAC_OS_X_VERSION_10_15 is only defined on SDKs new enough to include its functionality (including iOS, tvOS, etc)
#ifdef MAC_OS_X_VERSION_10_15
if (@available(macOS 10.15, iOS 11, tvOS 14.5, *)) {