[{"id":36260,"web_url":"https://patchwork.libcamera.org/comment/36260/","msgid":"<176055809174.162040.6876981125115738907@ping.linuxembedded.co.uk>","date":"2025-10-15T19:54:51","subject":"Re: [PATCH v3 03/39] meson: Automatically generate glsl_shaders.h\n\tfrom specified shader programs","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Bryan O'Donoghue (2025-10-15 02:22:15)\n> Encode the bayer shader files into a header as part of the build process.\n> Qcam already compiles the shader files down into a QT resource file which\n> it references internally.\n> \n> In order to share the debayering shader programs outside of qcam create a\n> generic header which both qcam and libcamera can operate from.\n> \n\nAcked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>  include/libcamera/internal/meson.build         | 10 ++++++++++\n>  include/libcamera/internal/shaders/meson.build | 10 ++++++++++\n>  utils/meson.build                              |  2 ++\n>  3 files changed, 22 insertions(+)\n>  create mode 100644 include/libcamera/internal/shaders/meson.build\n> \n> diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build\n> index 45c299f6..ecb7c9fa 100644\n> --- a/include/libcamera/internal/meson.build\n> +++ b/include/libcamera/internal/meson.build\n> @@ -1,6 +1,7 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>  \n>  subdir('tracepoints')\n> +subdir('shaders')\n>  \n>  libcamera_internal_headers = files([\n>      'bayer_format.h',\n> @@ -59,5 +60,14 @@ tracepoints_h = custom_target(\n>  \n>  libcamera_internal_headers += tracepoints_h\n>  \n> +libcamera_shader_headers = custom_target(\n> +    'gen-shader-headers',\n> +    input : [shader_files],\n> +    output : 'glsl_shaders.h',\n> +    command : [gen_shader_headers, meson.project_source_root(), meson.project_build_root(), '@OUTPUT@', '@INPUT@'],\n> +)\n> +\n> +libcamera_internal_headers += libcamera_shader_headers\n> +\n>  subdir('converter')\n>  subdir('software_isp')\n> diff --git a/include/libcamera/internal/shaders/meson.build b/include/libcamera/internal/shaders/meson.build\n> new file mode 100644\n> index 00000000..386b342d\n> --- /dev/null\n> +++ b/include/libcamera/internal/shaders/meson.build\n> @@ -0,0 +1,10 @@\n> +# SPDX-License-Identifier: CC0-1.0\n> +\n> +# List of shader files to convert to header hex\n> +# for the purposes of inclusion in OpenGL debayering\n> +shader_files = files([\n> +    'bayer_1x_packed.frag',\n> +    'bayer_8.frag',\n> +    'bayer_8.vert',\n> +    'identity.vert',\n> +])\n> diff --git a/utils/meson.build b/utils/meson.build\n> index 95d657ac..3deed8ad 100644\n> --- a/utils/meson.build\n> +++ b/utils/meson.build\n> @@ -3,5 +3,7 @@\n>  subdir('codegen')\n>  subdir('ipu3')\n>  \n> +gen_shader_headers = files('gen-shader-headers.sh')\n> +\n>  ## Module signing\n>  gen_ipa_priv_key = files('gen-ipa-priv-key.sh')\n> -- \n> 2.51.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 9AE8CC3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Oct 2025 19:54:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C393B60632;\n\tWed, 15 Oct 2025 21:54:56 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C636160615\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Oct 2025 21:54:54 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5705CE7C;\n\tWed, 15 Oct 2025 21:53:15 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"IAiod4NU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1760557995;\n\tbh=pWUiREGx5z2m2+OlSdFxJ4n+xwTpoMcrTBrlDzlBdCE=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=IAiod4NUuNVJ4Qh3DkYAdKioetRE3e5wnab6v/VEHw4P/XMT2hVqbXldfbfqC1CgT\n\t5r4GAvwkhqGgR1u8yyznEhrXvxLLKv+5Fn+XfXNlOXWYK3jz3lvSBjf3acCxFgOnFQ\n\tYCe/tet70UPTSxE8NrCKW3ImQz5EUVp29TsPBGv4=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251015012251.17508-4-bryan.odonoghue@linaro.org>","References":"<20251015012251.17508-1-bryan.odonoghue@linaro.org>\n\t<20251015012251.17508-4-bryan.odonoghue@linaro.org>","Subject":"Re: [PATCH v3 03/39] meson: Automatically generate glsl_shaders.h\n\tfrom specified shader programs","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"hdegoede@redhat.com, mzamazal@redhat.com, bryan.odonoghue@linaro.org,\n\tbod.linux@nxsw.ie","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 15 Oct 2025 20:54:51 +0100","Message-ID":"<176055809174.162040.6876981125115738907@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]