From patchwork Tue Apr 22 21:59:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 23239 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 08ED8C327D for ; Tue, 22 Apr 2025 22:00:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7AC7468B3A; Wed, 23 Apr 2025 00:00:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="TlpT8OvI"; dkim-atps=neutral Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8EE4A68B41 for ; Tue, 22 Apr 2025 23:59:48 +0200 (CEST) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-391342fc0b5so4703318f8f.3 for ; Tue, 22 Apr 2025 14:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745359188; x=1745963988; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fTSmECeJyXTca49Z/7YULmR0N2gCFQELi3K5iShO2Yo=; b=TlpT8OvIpS1p85iosstRq1FXW0cCTTe0EyfEGrYygC7HrFq4iSVPqavMIT3KAZsquh jESaex90DIzw9ZoHvpZ+0K05ED1buX6f9f6Kut6vwFT9UA9MvYvlo4qZEtb69csaM+04 UCEckb8oEAqrcu0QtozJAgPLSgTtpeqlh80MsGacylhRe3tmbD2BqgqenWFz11Gx7YEs Bw+EMjZ7qq2bxgVfbed9kgcvuOk4sRifc/VT2mf0kEyM+M5q0CZXhkXTb3b7Tcj3KxB9 h+AEu+xurP5yNUfCjQXrFTjfHq/D2BAqtmr49gKVse8ufE/kwtGaMCx8zy+20opYCUs3 +ahA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745359188; x=1745963988; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fTSmECeJyXTca49Z/7YULmR0N2gCFQELi3K5iShO2Yo=; b=ElFcwzPVmIjZ4+O1zLIiiJOckDOPCjDse2qvxwXl3HIzX8O3NMAnstmdMZT5FrkcVr 5fAj8nhSzmaw+Vye2ApQO4d+IHtB3iFVc7J94NmhFEBdmF01QQDDJKww9fibBVPJk9dq CBVxONZ0hDQcdIfU05EdC9QNmGbSU/p4JN2+E4eJ/K137+g6lvFGINbSDPcTnxFLaLn0 ZUxV75k8LEklRqHecFokHWbb7BzKy8hyZN3UkmYsm+fR2jLheqGc0CHaS34Zce7NGO6h SJCjFrRl8VkiAt8+ogA0f+lLohgzRJOVcLrZW+ENxC3Uy8MGu7tVERm5wXk8rOp50BVJ rLDg== X-Gm-Message-State: AOJu0YynMk620/lDZzFOnKBCwVAshtjeNY1e3byv1iqmsX+TSquoUllZ vzMmuhp7CYra5e2qi5GSpzidQlIc6ANi2d20fgQFnEB89QSorYR9x0edw1jxE8zwAn0KhMhaIdg 6E7Q= X-Gm-Gg: ASbGnctu5gYbaGm+zS4+BBBM3QMa+lxmSq71vMBoSd28VI9Jsx1egIYcQKLJteMtRGf 103DftfoO7bNrji/iWthGn/4bHMobIO5u3eIs57d0BCQXjKeva8eZsIgC79U+D9Nxgh2RvTVYmD YebSy4Lc7S6vkebEbSNBSJ3hhiE5dRu5C1cd8nHNh3p7qTFhqRpEqMGaxIthiMd/qb99FuDwGH1 pdci8Ksp3jSu7lypW8ArKrsBuEVsYUWrk2JAShfdvHQRgx/9EMi/JsfPHf6ZeSuxoUiNA4TPdcu Q8Ptk+GyqNELWeBlCVY7DbjeadEpTXWwEPmj0/xThXluepe1tsAbqKVfEmxJ+CXaXECwWuP0XWF 5GXMN+ZOK4FyhTtVnffko X-Google-Smtp-Source: AGHT+IElAOSpZGrmqvFgKwbc4mb+TviYAr/wclm4q+D+YVXyf2yM7qm2W2esvxyYkGFrZ1prh0PvNw== X-Received: by 2002:a5d:64ae:0:b0:390:e7c1:59c4 with SMTP id ffacd0b85a97d-39efba50a80mr14943572f8f.13.1745359187945; Tue, 22 Apr 2025 14:59:47 -0700 (PDT) Received: from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-44092d2eccesm2726615e9.20.2025.04.22.14.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Apr 2025 14:59:47 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: hdegoede@redhat.com, mzamazal@redhat.com, bryan.odonoghue@linaro.org, bod.linux@nxsw.ie Subject: [PATCH 26/27] meson: Automatically generate glsl_shaders.h from specified shader programs Date: Tue, 22 Apr 2025 22:59:19 +0100 Message-ID: <20250422215920.4297-27-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250422215920.4297-1-bryan.odonoghue@linaro.org> References: <20250422215920.4297-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Encode the bayer shader files into a header as part of the build process. Qcam already compiles the shader files down into a QT resource file which it references internally. In order to share the debayering shader programs outside of qcam create a generic header which both qcam and libcamera can operate from. Signed-off-by: Bryan O'Donoghue --- include/libcamera/internal/meson.build | 10 ++++++++++ include/libcamera/internal/shaders/meson.build | 10 ++++++++++ utils/meson.build | 2 ++ 3 files changed, 22 insertions(+) create mode 100644 include/libcamera/internal/shaders/meson.build diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 45408b31..10cd4930 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -1,6 +1,7 @@ # SPDX-License-Identifier: CC0-1.0 subdir('tracepoints') +subdir('shaders') libcamera_internal_headers = files([ 'bayer_format.h', @@ -56,5 +57,14 @@ tracepoints_h = custom_target( libcamera_internal_headers += tracepoints_h +libcamera_shader_headers = custom_target( + 'gen-shader-headers', + input : [shader_files], + output : 'glsl_shaders.h', + command : [gen_shader_headers, meson.project_source_root(), meson.project_build_root(), '@OUTPUT@', '@INPUT@'], +) + +libcamera_internal_headers += libcamera_shader_headers + subdir('converter') subdir('software_isp') diff --git a/include/libcamera/internal/shaders/meson.build b/include/libcamera/internal/shaders/meson.build new file mode 100644 index 00000000..386b342d --- /dev/null +++ b/include/libcamera/internal/shaders/meson.build @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: CC0-1.0 + +# List of shader files to convert to header hex +# for the purposes of inclusion in OpenGL debayering +shader_files = files([ + 'bayer_1x_packed.frag', + 'bayer_8.frag', + 'bayer_8.vert', + 'identity.vert', +]) diff --git a/utils/meson.build b/utils/meson.build index 95d657ac..3deed8ad 100644 --- a/utils/meson.build +++ b/utils/meson.build @@ -3,5 +3,7 @@ subdir('codegen') subdir('ipu3') +gen_shader_headers = files('gen-shader-headers.sh') + ## Module signing gen_ipa_priv_key = files('gen-ipa-priv-key.sh')