From patchwork Fri Oct 4 09:31:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 52035 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:938f:0:b0:48e:c0f8:d0de with SMTP id z15csp278783vqg; Fri, 4 Oct 2024 02:32:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU54RDxjF1F0BLgo8cbbMF0qz5w3g7qaOYkDXozR0IO0TD8aVb6wSalcR+6Co9iAp0y5liNk13MzA3lNFJs2zda@gmail.com X-Google-Smtp-Source: AGHT+IHSh/vNb2Nmg4mC3NIZqp9fFaoorJe/Dt3k+4zUzNSriJp3kNY2El/ohNk0z/N8/IBzsXuX X-Received: by 2002:a05:6402:5411:b0:5c2:609d:397e with SMTP id 4fb4d7f45d1cf-5c8d2e27df8mr1301983a12.15.1728034340082; Fri, 04 Oct 2024 02:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728034340; cv=none; d=google.com; s=arc-20240605; b=dV8sbPAZKOrnTl2uI6LMgn+eeye0HvNNRhx6dHT7J35sVizH6XpxKp7dIAKv/CkrX4 PKGoJrJ5MTzW4+uoVoLFnxsuDbO6w53uZZgYjUWgQ16kk5px5OPCJ4E4A5IzgKd6iICu LPgJIKbPS/smoJWeK28zWkalKzCnRCrCUkAixI+41EEAdlliMo5FAR/EbsKLhEn/4k9y 2uGLLYvdG6h1kup7+HYZ4dE1olThrUIMUvcsTiTcYkzrdbvn/44/d7O0Z6lq12/HwGH0 YBKACdpffIyESxQb72szizcXwJKgS1LejvYsu9DMdYoN+iD3b+pCOWjKgjaJ/VC+U7nJ EFvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:cc:reply-to:from :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:delivered-to; bh=JifHxLEIvBn6LqAF2wXqtzRB4MUFRCOOHISqN+pqIzA=; fh=nenT92/WZoU6unXd3J6UhGUdod4piddKfVtctNBOh6k=; b=cP+DdCr29xwFPmGbgtpuwxdChkmvC7Yi/jkFDubdG7oVY5AYy5a4nD30paPiPrTh3H uG+Ydz/inDrwQRHjgcoPxi51AFXmpuGGEnY+Ly0taXAyJPKj3CZfLroJwS9rw+8lPQIf ZcCRVF7MKFSCRn7YGKJWFYiyGdFLV23NP0h4a4UkJnWuzNklK+GyMz9nmXKHyZj22FHy CqEhxHcI3f59+qwzKsgwuQ+atj8ntG7OFFhIQOORmrbUeHZo1+V/iExKQfGJRFC6rNNR vvlJLnq6OCqfbvKOOVWVVPE0gyyiRg8Ef8Q6e4BnN8kPylUeD2Yx39O/JWJJ2FV42dll aN5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5c8ca3c1cd0si2140484a12.81.2024.10.04.02.32.19; Fri, 04 Oct 2024 02:32:20 -0700 (PDT) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3523268DB4D; Fri, 4 Oct 2024 12:31:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vidala.lynne.ee (vidala.pars.ee [116.203.72.101]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2163768DA5B for ; Fri, 4 Oct 2024 12:31:40 +0300 (EEST) To: ffmpeg-devel@ffmpeg.org Date: Fri, 4 Oct 2024 11:31:31 +0200 Message-ID: <20241004093137.139470-4-dev@lynne.ee> X-Mailer: git-send-email 2.45.2.753.g447d99e1c3b In-Reply-To: <20241004093137.139470-1-dev@lynne.ee> References: <20241004093137.139470-1-dev@lynne.ee> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] lavc/vulkan: add SPIR-V compilation support 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: , X-Patchwork-Original-From: Lynne via ffmpeg-devel From: Lynne Reply-To: FFmpeg development discussions and patches Cc: Lynne Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: O8HkLCnS2kYE This is the same as with libavfilter. We will need SPIR-V compilation for at least three different things, like the VC-2 encoder and decoder, AV1 film grain synthesis for hardware with no support for it, and possibly other codecs. --- libavcodec/Makefile | 4 ++++ libavcodec/vulkan_glslang.c | 19 +++++++++++++++++++ libavcodec/vulkan_shaderc.c | 19 +++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 libavcodec/vulkan_glslang.c create mode 100644 libavcodec/vulkan_shaderc.c diff --git a/libavcodec/Makefile b/libavcodec/Makefile index a253a9b160..7147ed0360 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1257,6 +1257,10 @@ OBJS-$(HAVE_THREADS) += pthread.o pthread_slice.o pthread_fram OBJS-$(CONFIG_FRAME_THREAD_ENCODER) += frame_thread_encoder.o +# vulkan libs +OBJS-$(CONFIG_LIBGLSLANG) += vulkan_glslang.o +OBJS-$(CONFIG_LIBSHADERC) += vulkan_shaderc.o + # Windows resource file SHLIBOBJS-$(HAVE_GNU_WINDRES) += avcodecres.o diff --git a/libavcodec/vulkan_glslang.c b/libavcodec/vulkan_glslang.c new file mode 100644 index 0000000000..9aa41567a3 --- /dev/null +++ b/libavcodec/vulkan_glslang.c @@ -0,0 +1,19 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/vulkan_glslang.c" diff --git a/libavcodec/vulkan_shaderc.c b/libavcodec/vulkan_shaderc.c new file mode 100644 index 0000000000..9f60bf4dfd --- /dev/null +++ b/libavcodec/vulkan_shaderc.c @@ -0,0 +1,19 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/vulkan_shaderc.c"