From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5776E4024F for ; Fri, 12 Jul 2024 17:48:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6290F68DAF5; Fri, 12 Jul 2024 20:48:19 +0300 (EEST) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2F3F868DA6F for ; Fri, 12 Jul 2024 20:48:08 +0300 (EEST) Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-58b966b41fbso2850190a12.1 for ; Fri, 12 Jul 2024 10:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720806487; x=1721411287; darn=ffmpeg.org; h=subject:date:from:to:message-id:in-reply-to:from:to:cc:subject:date :message-id:reply-to; bh=vBFVT3AZ6sWlycIPIVv6XazXeXvyfhEF40GQeGh7mLg=; b=cCwxTSaMg3O21ZBueA1bf2yv034ua0Ljbr57sAgieAH6irQKy6IgfCNhpt3bFj/L7g D1C5yOb54KzKN6gMb/cc2trXWmo9Xd13tOo1aHvv5L/5VBQNEpy0pz1vAtb6dO4JOaWK itJ2pta8oK/07q1s7Fuu82MrPH/2CxOsD4YCfzBOHbrClzBY0wGW0zEp62PBX1VZ7gwJ 2oBPt4N3cbkcUFnMkVK2XSMrXChr4WC10q2Mpn69sDBWrp1ST5jpS6FnI78p67JwR17C j022nMVwysdJOPqgnzxUwelBLOfrMEZPKyY/5Ghcz6JQcv6ieWgzBatu1P/wbVeUE0ce Cn6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720806487; x=1721411287; h=subject:date:from:to:message-id:in-reply-to:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vBFVT3AZ6sWlycIPIVv6XazXeXvyfhEF40GQeGh7mLg=; b=JmjsOowrQM6mVGeDmoIOIl0GNl66Xhw7dQfmYzuYH/EHgPSmNUVxa3CFfBtbBc4KFA mKxq6OVRH6Q4yATRUOs1LSoHFaTYvZT4AlsSR4xrUZWcblO3pdlnJKcc/P1klazxsifS 7XbRZ5iBuAKQgzWVlETIptH7tVzta8CV3PKbMiOrRY/I3BLLYPg9Evlj3D7kIiBFqK1w 3OlGRol+6B3tHukbC4nT35lJUK+Vw6XN+KJ9ab4cWEttZHyUYdA3KVzJG4Z/nG8c9MSK a9j/p1j1zpAuMJefqmCnJOvlkNr1nkOGMplTHN22VWGoxTP/MNeSjxKI4XNlyJRB9c8G mf7Q== X-Gm-Message-State: AOJu0Yw37sN8ynLMONmdaM5liQmqEJwFhJ6/8qq7ahcxn1nWFejpD5wt 5opk60F4CBj0tpoSJHCokyv0GgBQsPhz6dhbKU/XaqSQPXaqenr0Ug3FpA== X-Google-Smtp-Source: AGHT+IHN4/tWdddhJ99iLAbIRwvLu/YcomsrbW3gLpVSS+CD6ygNzRTjkslpIZR9a74d18gRPytRMw== X-Received: by 2002:a05:6402:1ecf:b0:586:12f6:c0fe with SMTP id 4fb4d7f45d1cf-594ba99755cmr9701499a12.5.1720806487486; Fri, 12 Jul 2024 10:48:07 -0700 (PDT) Received: from localhost (p200300cccf1e25001072fbc25e6664b9.dip0.t-ipconnect.de. [2003:cc:cf1e:2500:1072:fbc2:5e66:64b9]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-594bd45a1b6sm4753150a12.60.2024.07.12.10.48.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Jul 2024 10:48:07 -0700 (PDT) In-Reply-To: Message-Id: To: From: "Marvin Scholz" Date: Fri, 12 Jul 2024 18:21:21 +0200 Subject: [FFmpeg-devel] [PATCH 06/11] lavfi/metal: simplify fallback X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Instead of using a fallback variable, just do an early return. --- libavfilter/metal/utils.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavfilter/metal/utils.m b/libavfilter/metal/utils.m index d5c85e619d..6a9e5ef7cf 100644 --- a/libavfilter/metal/utils.m +++ b/libavfilter/metal/utils.m @@ -24,7 +24,6 @@ void ff_metal_compute_encoder_dispatch(id device, id encoder, NSUInteger width, NSUInteger height) { - BOOL fallback = YES; MTLSize threadsPerThreadgroup; NSUInteger w, h; @@ -39,11 +38,13 @@ void ff_metal_compute_encoder_dispatch(id 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); -- 2.39.3 (Apple Git-146) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".