From patchwork Wed Nov 10 07:20:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 31358 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp71735iob; Tue, 9 Nov 2021 23:20:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZC43WeklpW6N2krcO/5saeErcSVzfbm5Q+NbgGW6bkIjjdUAD7NlJN9+hv8r9MWVUqh8I X-Received: by 2002:a17:906:9153:: with SMTP id y19mr17350101ejw.516.1636528832688; Tue, 09 Nov 2021 23:20:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636528832; cv=none; d=google.com; s=arc-20160816; b=QulJ3loZhGKfk/lYP717TLa756SbrZODmuoPa4liaJDH7kXdX4csYhAwhhpc+orh8G 9ncHW49WtjIOWckTA5afw6KwCYntSvxOOnJvvYozFqf8LB42HCQ3GQfovB+Y9iYaVteR F6QroZcxTulMizibZfYUDwlUYB1OCJQbDituG4PCxvJmsBMoWhmX8o1/kEaGcVelwfhL XiGukLegynLY19YqGnoU0bEEMDxXoP4kKVzECWYDbRQjRmSLwqWinBslfwMnepUInwEB smz0FCrOaXK5nT5kltgJpLH69J17uJviaeWf6vGbpIYSMYhWU4vnGlk4LoZRpP38K8wb qJGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:to:from:date:dkim-signature:delivered-to; bh=7F1ia1xKNtPfRjLmNFQOvNtkIINeWUup9meB70tjxww=; b=GG9PjRq25VwupDPRzXJiHnNvyRHwB6YTZ2pu2b5eyNP8Lcul8FyKGSzg6rirGAeT0W whatC6Xp6IZnJzBT3+xHb47JyecA+iIs+IufZXWsojx+kx1w5pHJjGw76O4rxPn66YE9 T/bOi6T2/O4JA9NsAIiEQZ98gYLf6IhPFKl404Pti7G/s7hgi4OMQk7BxkDVuKEv5JXX iLEwnxso1bYfvIrwErRuUqarULRla8UJSK6wL+1abiZp03LfvWVxuJvzbmtFLkdcHV0B LmfgqI+NorMS3LFfQK0Gv69ufIeiDJvw4UgXRrnwe1ya7lc16n3ZSOYUhUy44qGsl4HI O10w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@lynne.ee header.s=s1 header.b=A1PtZFgF; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lynne.ee Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t6si33457085edt.481.2021.11.09.23.20.31; Tue, 09 Nov 2021 23:20:32 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@lynne.ee header.s=s1 header.b=A1PtZFgF; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lynne.ee Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6F1F0680717; Wed, 10 Nov 2021 09:20:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 87AF368A77A for ; Wed, 10 Nov 2021 09:20:15 +0200 (EET) Received: from w3.tutanota.de (unknown [192.168.1.164]) by w4.tutanota.de (Postfix) with ESMTP id C80C61060235 for ; Wed, 10 Nov 2021 07:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1636528814; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=IU8cx/V2c4LHo8eFz154KbuLyCzGh3u/dvU9jqsiU2U=; b=A1PtZFgFrvdMFnb4dlPevc/TWPOWQ++mFjps53DjXP0rjLZjpOAh52JK5czxssG8 a6B5sKWlX1eigQKg8GPcAEtAAs2tX440bornbpLJ4pfb0q5m6gXFr4Cs78+6ApERRnh VBX/YUB2cjfIurh4awEJMsWFfAqeJutE6qzOpbA/k4stc2Clw2EQqbPDV1FwpHAiPvL FzjdJQNyWsTNyxyY9Uo0gP02v1jvAmAau7U6aDtyJ8egKWcu4lsxYYQx3uILUxPmJF6 eELygLF1badq6y+mSVKt17B0V7MkgnTLL9JNOUua24hJBJhblP6+YxPkMSamPlzDYpV 5TaJcmoMHQ== Date: Wed, 10 Nov 2021 08:20:14 +0100 (CET) From: Lynne To: Ffmpeg Devel Message-ID: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 0/14] Vulkan fixes and improvements 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 7VWXEljoQHqs I've extensively fixed and improved our Vulkan codebase, and it's now up to standard. Since it's a 14-part patchset, I've uploaded my branch for review here: https://github.com/cyanreg/FFmpeg/tree/vulkan The implementation now follows modern Vulkan API usage practices, fully takes advantage of all the hardware has to offer, it's faster, much easier to compile, static linking is possible and most importantly, it's bug-free and extendable. Of interest to anyone who's only interested in public API changes are patches 2/14 and 6/14. The changes made are backwards compatible, and will not break API users. I've collaborated with Niklas Haas to make our APIs compatible, and we've both improved our codebases in the process. He'll be submitting a long-requested vf_libplacebo filter for review as soon as this gets merged. I'm also working on a Vulkan hwaccel using the new decode API, the branch for which can be found here: https://github.com/cyanreg/FFmpeg/commits/vulkan_decode Notably, libavfilter/vulkan.c will be moved into libavcodec/vulkan.h, and will be used to handle both filtering and decoding/encoding. No API changes will be required for it. I've also attached the patchset here. Subject: [PATCH 01/14] hwcontext_vulkan: bump required Vulkan loader version to 1.2 --- configure | 6 +++--- libavutil/hwcontext_vulkan.c | 2 +- libavutil/hwcontext_vulkan.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure b/configure index c01aa480c7..103829e688 100755 --- a/configure +++ b/configure @@ -6824,10 +6824,10 @@ enabled vdpau && enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd if enabled vulkan; then - require_pkg_config_cpp vulkan "vulkan >= 1.1.97" "vulkan/vulkan.h" "defined VK_VERSION_1_1" || - require_cpp_condition vulkan "vulkan/vulkan.h" "defined VK_VERSION_1_1" + require_pkg_config_cpp vulkan "vulkan >= 1.2.189" "vulkan/vulkan.h" "defined VK_VERSION_1_2" || + require_cpp_condition vulkan "vulkan/vulkan.h" "defined VK_VERSION_1_2" # vulkan_lib should be removed once glslang filters are updated - check_pkg_config vulkan_lib "vulkan >= 1.1.97" "vulkan/vulkan.h" vkCreateInstance + check_pkg_config vulkan_lib "vulkan >= 1.2.189" "vulkan/vulkan.h" vkCreateInstance fi if enabled x86; then diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 2c3216857a..570ebf23bb 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -676,7 +676,7 @@ static int create_instance(AVHWDeviceContext *ctx, AVDictionary *opts) VkApplicationInfo application_info = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pEngineName = "libavutil", - .apiVersion = VK_API_VERSION_1_1, + .apiVersion = VK_API_VERSION_1_2, .engineVersion = VK_MAKE_VERSION(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO), diff --git a/libavutil/hwcontext_vulkan.h b/libavutil/hwcontext_vulkan.h index e4645527d7..8d1ae50e65 100644 --- a/libavutil/hwcontext_vulkan.h +++ b/libavutil/hwcontext_vulkan.h @@ -50,7 +50,7 @@ typedef struct AVVulkanDeviceContext { PFN_vkGetInstanceProcAddr get_proc_addr; /** - * Vulkan instance. Must be at least version 1.1. + * Vulkan instance. Must be at least version 1.2. */ VkInstance inst;