[{"id":39512,"web_url":"https://patchwork.libcamera.org/comment/39512/","msgid":"<85mrwc1gz7.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-06-30T10:05:00","subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:\n\n> The shader header is generated by a combination of a shell script and a\n> Python script. Simplify this by merging everything into a single script.\n>\n> The output of the old and new script only differ in white spaces.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n>  src/libcamera/shaders/meson.build |  2 +-\n>  utils/gen-shader-header.py        | 37 ----------------\n>  utils/gen-shader-headers.py       | 71 +++++++++++++++++++++++++++++++\n>  utils/gen-shader-headers.sh       | 54 -----------------------\n>  utils/meson.build                 |  2 +-\n>  5 files changed, 73 insertions(+), 93 deletions(-)\n>  delete mode 100755 utils/gen-shader-header.py\n>  create mode 100755 utils/gen-shader-headers.py\n>  delete mode 100755 utils/gen-shader-headers.sh\n>\n> diff --git a/src/libcamera/shaders/meson.build b/src/libcamera/shaders/meson.build\n> index adac77327a3b..4f4e8da607c7 100644\n> --- a/src/libcamera/shaders/meson.build\n> +++ b/src/libcamera/shaders/meson.build\n> @@ -14,7 +14,7 @@ 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(), '@OUTPUT@', '@INPUT@'],\n> +    command : [gen_shader_headers, '-o', '@OUTPUT@', '@INPUT@'],\n>  )\n>  \n>  libcamera_internal_headers += libcamera_shader_headers\n> diff --git a/utils/gen-shader-header.py b/utils/gen-shader-header.py\n> deleted file mode 100755\n> index 745852b4c03f..000000000000\n> --- a/utils/gen-shader-header.py\n> +++ /dev/null\n> @@ -1,37 +0,0 @@\n> -#!/usr/bin/env python3\n> -# SPDX-License-Identifier: GPL-2.0-or-later\n> -# Copyright (C) 2025, Bryan O'Donoghue.\n> -#\n> -# Author: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> -#\n> -# A Python script which takes a list of shader files and converts each of them\n> -# into a C header.\n> -#\n> -import sys\n> -\n> -try:\n> -    with open(sys.argv[2], \"rb\") as file:\n> -        data = file.read()\n> -        data_len = len(data)\n> -\n> -        name = sys.argv[1].replace(\".\", \"_\")\n> -        name_len = name + \"_len\"\n> -\n> -        j = 0\n> -        print(\"unsigned char const\", name, \"[] = {\")\n> -        for ch in data:\n> -            print(f\"0x{ch:02x}, \", end=\"\")\n> -            j = (j + 1) % 16\n> -            if j == 0:\n> -                print()\n> -        if j != 0:\n> -            print()\n> -        print(\"};\")\n> -\n> -        print()\n> -        print(f\"const unsigned int {name_len}={data_len};\")\n> -\n> -except FileNotFoundError:\n> -    print(f\"File {sys.argv[2]} not found\", file=sys.stderr)\n> -except IOError:\n> -    print(f\"Unable to read {sys.argv[2]}\", file=sys.stderr)\n> diff --git a/utils/gen-shader-headers.py b/utils/gen-shader-headers.py\n> new file mode 100755\n> index 000000000000..908217a2bd2e\n> --- /dev/null\n> +++ b/utils/gen-shader-headers.py\n> @@ -0,0 +1,71 @@\n> +#!/usr/bin/env python3\n> +# SPDX-License-Identifier: GPL-2.0-or-later\n> +#\n> +# Copyright (C) 2025, Bryan O'Donoghue\n> +# Copyright (C) 2026, Ideas on Board Oy\n> +#\n> +# Generate a C header file containing hex-encoded shader sources\n> +\n> +import argparse\n> +import binascii\n> +import math\n> +import os\n> +import sys\n> +\n> +\n> +def process_file(name, out):\n> +    data = open(name, 'rb').read()\n> +\n> +    hex_data = [f'0x{c:02x}' for c in data]\n> +    var_name = os.path.basename(name).replace('.', '_')\n> +\n> +    out.write(f'unsigned char const {var_name}[] = {{\\n')\n> +\n> +    for i in range(math.ceil(len(data) / 16)):\n> +        out.write('\\t')\n> +        out.write(', '.join(hex_data[16 * i:16 * (i + 1)]))\n> +        out.write(',\\n')\n> +\n> +    out.write('};\\n\\n')\n> +    out.write(f'const unsigned int {var_name}_len = {len(data)};\\n')\n> +\n> +\n> +def main(argv):\n> +    parser = argparse.ArgumentParser(\n> +        description='Generate a C header file containing hex-encoded shader sources')\n> +    parser.add_argument('--output', '-o', metavar='file', default=sys.stdout,\n> +                        type=argparse.FileType('w', encoding='utf-8'),\n> +                        help='Output file name. Defaults to standard output if not specified.')\n> +    parser.add_argument('input', nargs='+', type=str,\n> +                        help='Input file names.')\n> +    args = parser.parse_args(argv[1:])\n> +\n> +    args.output.write('''/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/* This file is auto-generated, do not edit! */\n> +\n> +#pragma once\n> +\n> +/*\n> + * List the names of the shaders at the top of header for readability's sake.\n> + *\n> +''')\n> +\n> +    for name in args.input:\n> +        name = os.path.basename(name).replace('.', '_')\n> +        args.output.write(f' * unsigned char {name};\\n')\n> +\n> +    args.output.write(''' */\n> +\n> +/* Hex encoded shader data */\n> +''')\n> +\n> +    for name in args.input:\n> +        process_file(name, args.output)\n> +        args.output.write('\\n')\n> +\n> +    return 0\n> +\n> +\n> +if __name__ == '__main__':\n> +    sys.exit(main(sys.argv))\n> +\n> diff --git a/utils/gen-shader-headers.sh b/utils/gen-shader-headers.sh\n> deleted file mode 100755\n> index 0d6649521a7a..000000000000\n> --- a/utils/gen-shader-headers.sh\n> +++ /dev/null\n> @@ -1,54 +0,0 @@\n> -#!/bin/sh\n> -# SPDX-License-Identifier: GPL-2.0-or-later\n> -\n> -set -e\n> -\n> -usage() {\n> -\techo \"Usage: $0 <src_dir> <output_header> <shader_file1> [shader_file2 ...]\"\n> -\techo\n> -\techo \"Generates a C header file containing hex-encoded shader data.\"\n> -\techo\n> -\techo \"Arguments:\"\n> -\techo \"  src_dir             Path to the base of the source directory\"\n> -\techo \"  output_header       Path to the generated header file\"\n> -\techo \"  shader_file(s)      One or more shader files to embed in the header\"\n> -\texit 1\n> -}\n> -\n> -if [ $# -lt 4 ]; then\n> -\techo \"Error: Invalid argument count.\"\n> -\tusage\n> -fi\n> -\n> -src_dir=\"$1\"; shift\n> -build_path=\"$1\"; shift\n> -\n> -cat <<EOF > \"$build_path\"\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/* This file is auto-generated, do not edit! */\n> -\n> -#pragma once\n> -\n> -EOF\n> -\n> -cat <<EOF >> \"$build_path\"\n> -/*\n> - * List the names of the shaders at the top of\n> - * header for readability's sake\n> - *\n> -EOF\n> -\n> -for file in \"$@\"; do\n> -\tname=$(basename \"$file\" | tr '.' '_')\n> -\techo \"[SHADER-GEN] $name\"\n> -\techo \" * unsigned char $name;\" >> \"$build_path\"\n> -done\n> -\n> -echo \"*/\" >> \"$build_path\"\n> -\n> -echo \"/* Hex encoded shader data */\" >> \"$build_path\"\n> -for file in \"$@\"; do\n> -\tname=$(basename \"$file\")\n> -\t\"$src_dir/utils/gen-shader-header.py\" \"$name\" \"$file\" >> \"$build_path\"\n> -\techo >> \"$build_path\"\n> -done\n> diff --git a/utils/meson.build b/utils/meson.build\n> index 9c598793035c..17a7aa7c3f5e 100644\n> --- a/utils/meson.build\n> +++ b/utils/meson.build\n> @@ -3,7 +3,7 @@\n>  subdir('codegen')\n>  subdir('ipu3')\n>  \n> -gen_shader_headers = files('gen-shader-headers.sh')\n> +gen_shader_headers = files('gen-shader-headers.py')\n>  \n>  ## Module signing\n>  gen_ipa_priv_key = files('gen-ipa-priv-key.sh')","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 DC6DAC3261\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Jun 2026 10:05:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8B2A365F5F;\n\tTue, 30 Jun 2026 12:05:09 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9361A656D3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2026 12:05:07 +0200 (CEST)","from mail-wm1-f70.google.com (mail-wm1-f70.google.com\n\t[209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-615-0NCZSPJBO3auMjiKRdO29A-1; Tue, 30 Jun 2026 06:05:05 -0400","by mail-wm1-f70.google.com with SMTP id\n\t5b1f17b1804b1-490a767c7dcso34694415e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2026 03:05:04 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-4.net.vodafone.cz. [77.48.47.4])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-493b8ccc7d7sm59810115e9.2.2026.06.30.03.05.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 30 Jun 2026 03:05:02 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"KVjk7Xtu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1782813906;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=TnzXVls4op9vnsbXwDEl40pZPSe9PfWcpAzwivJGycM=;\n\tb=KVjk7Xtu0OVaq1wmiu6ceonc90JSfnt56fW73THbFOBK2+zIsf+hOKflhpiuNfnSRPgRQM\n\tJqKtpvpHIpIA5DTMpK/L0QuARLt2o4b42XqWOG47tz0FvHKTrsdi831cs13FBu47IjEdIS\n\tzdrPe4rVwgp9tGBabjaPJlSuQQ7Lvu4=","X-MC-Unique":"0NCZSPJBO3auMjiKRdO29A-1","X-Mimecast-MFC-AGG-ID":"0NCZSPJBO3auMjiKRdO29A_1782813904","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1782813904; x=1783418704;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=TnzXVls4op9vnsbXwDEl40pZPSe9PfWcpAzwivJGycM=;\n\tb=AjZ/z5QakLZ7nd7ahMzvhKB9np4/jOOONk4/vGqHCoG+/zo2cFl9XFhMwoXkB8x8FF\n\tSUc93HqSy09Soss1gqZNUke1OXOdOtL5DKvCQ80EHEcXG+87XIyGOGHbwo3a6bIMoQqD\n\tsnYgKXBkHlNCzBUx1uFgWmx1EQJSKri7DWzPuY4/Ftj0ou5Icn6UqTTi5OQmfQ9jlUIn\n\twhSjD4pnyKC6JYoVV1nZzNEiKnbSZHckVBjdNQYHauDJjDRQaHL2cpAWG1HXFzp/VoPO\n\tBMI297dNUNLlnaPEfg4PcpCl8N3aACDJ7WLk658gohfm7Hiie7RFf361mt5n3symWw/T\n\t8mVQ==","X-Gm-Message-State":"AOJu0Yy/ugutlRQmxMqIEhDxG9Xv13P9CtCiJv2OPhALGJFUwIYxv61d\n\ttDZAeJoOUb6GphV/kMgB0XCpYvO1ebndjjxBSdsh64aIhP+w+YI8JhHCAH8AMLaJpHu2UqWy7Aw\n\tZKzJn037W8oC5xDfzwGqRd+ef2yhLt2BPAtc3XrotdOxNfxEN/7iPM2YXQukAr1J5w5PzLhHhUg\n\t61iMxKsFg=","X-Gm-Gg":"AfdE7clG0xJQGAZdy86xZ0jK7rOnpzdPAUpgKt7yt4+TtxTBIOqIKm9GTcyqugf6S4S\n\t3CQxe7j/5YRlbiRSoeOr/ZlgSRBKR6haesxMpHC9cYZGo5HSdJIN77fpMdYfSX6xaHeLv0qSXz1\n\ts2QQMBck/EOYPOIWCAjGLRoSMggOd/xnnIzGpdB5U3T1q20yVVy7jc8sQufT+JnhiwWbhhi9Elz\n\tlZAPqr6vGy7pJfwEmmQG7EtgQpB+wxvkMwybARL/KIcFl7Y5paMw/vGM7aHV1fyCEUQ4w174EOE\n\t6GFFLOD43zS2Ticp0VtrH7Z7aCeL5f6i/2MjIEEczul/DXsIeEJO+Tj0VXsFaNAWp08ooRRmMY6\n\t0R9t2D4SmvD5blUd1jbEb7HCEMrFkjqwvgA3irEZF6Td+DIYs6HJQRW/rOnl5yckE","X-Received":["by 2002:a05:600c:8711:b0:493:a976:5c6e with SMTP id\n\t5b1f17b1804b1-493b8289eedmr43466415e9.16.1782813903795; \n\tTue, 30 Jun 2026 03:05:03 -0700 (PDT)","by 2002:a05:600c:8711:b0:493:a976:5c6e with SMTP id\n\t5b1f17b1804b1-493b8289eedmr43466055e9.16.1782813903365; \n\tTue, 30 Jun 2026 03:05:03 -0700 (PDT)"],"From":"Milan Zamazal <mzamazal@redhat.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Bryan O'Donoghue\n\t<bryan.odonoghue@linaro.org>","Subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","In-Reply-To":"<20260630083031.3197714-3-laurent.pinchart@ideasonboard.com>\n\t(Laurent Pinchart's message of \"Tue, 30 Jun 2026 11:30:29 +0300\")","References":"<20260630083031.3197714-1-laurent.pinchart@ideasonboard.com>\n\t<20260630083031.3197714-3-laurent.pinchart@ideasonboard.com>","Date":"Tue, 30 Jun 2026 12:05:00 +0200","Message-ID":"<85mrwc1gz7.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"qz9YfT9OSypC2zwmpK7KP3MsEqrIpHfynp-ZT6vwrfA_1782813904","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}},{"id":39519,"web_url":"https://patchwork.libcamera.org/comment/39519/","msgid":"<c4b2c800-8b3c-4d4d-9274-ee1ac07420ef@ideasonboard.com>","date":"2026-06-30T10:47:22","subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 06. 30. 10:30 keltezéssel, Laurent Pinchart írta:\n> The shader header is generated by a combination of a shell script and a\n> Python script. Simplify this by merging everything into a single script.\n> \n> The output of the old and new script only differ in white spaces.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>   src/libcamera/shaders/meson.build |  2 +-\n>   utils/gen-shader-header.py        | 37 ----------------\n>   utils/gen-shader-headers.py       | 71 +++++++++++++++++++++++++++++++\n>   utils/gen-shader-headers.sh       | 54 -----------------------\n>   utils/meson.build                 |  2 +-\n>   5 files changed, 73 insertions(+), 93 deletions(-)\n>   delete mode 100755 utils/gen-shader-header.py\n>   create mode 100755 utils/gen-shader-headers.py\n>   delete mode 100755 utils/gen-shader-headers.sh\n> \n> diff --git a/src/libcamera/shaders/meson.build b/src/libcamera/shaders/meson.build\n> index adac77327a3b..4f4e8da607c7 100644\n> --- a/src/libcamera/shaders/meson.build\n> +++ b/src/libcamera/shaders/meson.build\n> @@ -14,7 +14,7 @@ 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(), '@OUTPUT@', '@INPUT@'],\n> +    command : [gen_shader_headers, '-o', '@OUTPUT@', '@INPUT@'],\n>   )\n>   \n>   libcamera_internal_headers += libcamera_shader_headers\n> diff --git a/utils/gen-shader-header.py b/utils/gen-shader-header.py\n> deleted file mode 100755\n> index 745852b4c03f..000000000000\n> --- a/utils/gen-shader-header.py\n> +++ /dev/null\n> @@ -1,37 +0,0 @@\n> -#!/usr/bin/env python3\n> -# SPDX-License-Identifier: GPL-2.0-or-later\n> -# Copyright (C) 2025, Bryan O'Donoghue.\n> -#\n> -# Author: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> -#\n> -# A Python script which takes a list of shader files and converts each of them\n> -# into a C header.\n> -#\n> -import sys\n> -\n> -try:\n> -    with open(sys.argv[2], \"rb\") as file:\n> -        data = file.read()\n> -        data_len = len(data)\n> -\n> -        name = sys.argv[1].replace(\".\", \"_\")\n> -        name_len = name + \"_len\"\n> -\n> -        j = 0\n> -        print(\"unsigned char const\", name, \"[] = {\")\n> -        for ch in data:\n> -            print(f\"0x{ch:02x}, \", end=\"\")\n> -            j = (j + 1) % 16\n> -            if j == 0:\n> -                print()\n> -        if j != 0:\n> -            print()\n> -        print(\"};\")\n> -\n> -        print()\n> -        print(f\"const unsigned int {name_len}={data_len};\")\n> -\n> -except FileNotFoundError:\n> -    print(f\"File {sys.argv[2]} not found\", file=sys.stderr)\n> -except IOError:\n> -    print(f\"Unable to read {sys.argv[2]}\", file=sys.stderr)\n> diff --git a/utils/gen-shader-headers.py b/utils/gen-shader-headers.py\n> new file mode 100755\n> index 000000000000..908217a2bd2e\n> --- /dev/null\n> +++ b/utils/gen-shader-headers.py\n> @@ -0,0 +1,71 @@\n> +#!/usr/bin/env python3\n> +# SPDX-License-Identifier: GPL-2.0-or-later\n> +#\n> +# Copyright (C) 2025, Bryan O'Donoghue\n> +# Copyright (C) 2026, Ideas on Board Oy\n> +#\n> +# Generate a C header file containing hex-encoded shader sources\n> +\n> +import argparse\n> +import binascii\n> +import math\n> +import os\n> +import sys\n> +\n> +\n> +def process_file(name, out):\n> +    data = open(name, 'rb').read()\n> +\n> +    hex_data = [f'0x{c:02x}' for c in data]\n> +    var_name = os.path.basename(name).replace('.', '_')\n> +\n> +    out.write(f'unsigned char const {var_name}[] = {{\\n')\n> +\n> +    for i in range(math.ceil(len(data) / 16)):\n\nI wanted to suggest `itertools.batched()`, but I am afraid that is too new (python 3.12).\n\n\n> +        out.write('\\t')\n> +        out.write(', '.join(hex_data[16 * i:16 * (i + 1)]))\n> +        out.write(',\\n')\n> +\n> +    out.write('};\\n\\n')\n> +    out.write(f'const unsigned int {var_name}_len = {len(data)};\\n')\n> +\n> +\n> +def main(argv):\n> +    parser = argparse.ArgumentParser(\n> +        description='Generate a C header file containing hex-encoded shader sources')\n> +    parser.add_argument('--output', '-o', metavar='file', default=sys.stdout,\n> +                        type=argparse.FileType('w', encoding='utf-8'),\n> +                        help='Output file name. Defaults to standard output if not specified.')\n> +    parser.add_argument('input', nargs='+', type=str,\n\nCould be `type=pathlib.Path` to avoid `os.path` stuff.\n\n\n> +                        help='Input file names.')\n> +    args = parser.parse_args(argv[1:])\n> +\n> +    args.output.write('''/* SPDX-License-Identifier: LGPL-2.1-or-later */\n\nargs.output.write(\n'''\\\n/* SPDX-License-Identifier: LGPL-2.1-or-later */\n\nis an option to avoid having the first line be indented.\n\n\n> +/* This file is auto-generated, do not edit! */\n> +\n> +#pragma once\n> +\n> +/*\n> + * List the names of the shaders at the top of header for readability's sake.\n> + *\n> +''')\n> +\n> +    for name in args.input:\n> +        name = os.path.basename(name).replace('.', '_')\n> +        args.output.write(f' * unsigned char {name};\\n')\n\nI think the \"unsigned char\" part should be removed.\n\n\n> +\n> +    args.output.write(''' */\n> +\n> +/* Hex encoded shader data */\n> +''')\n> +\n> +    for name in args.input:\n> +        process_file(name, args.output)\n> +        args.output.write('\\n')\n> +\n> +    return 0\n> +\n> +\n> +if __name__ == '__main__':\n> +    sys.exit(main(sys.argv))\n> +\n> diff --git a/utils/gen-shader-headers.sh b/utils/gen-shader-headers.sh\n> deleted file mode 100755\n> index 0d6649521a7a..000000000000\n> --- a/utils/gen-shader-headers.sh\n> +++ /dev/null\n> @@ -1,54 +0,0 @@\n> -#!/bin/sh\n> -# SPDX-License-Identifier: GPL-2.0-or-later\n> -\n> -set -e\n> -\n> -usage() {\n> -\techo \"Usage: $0 <src_dir> <output_header> <shader_file1> [shader_file2 ...]\"\n> -\techo\n> -\techo \"Generates a C header file containing hex-encoded shader data.\"\n> -\techo\n> -\techo \"Arguments:\"\n> -\techo \"  src_dir             Path to the base of the source directory\"\n> -\techo \"  output_header       Path to the generated header file\"\n> -\techo \"  shader_file(s)      One or more shader files to embed in the header\"\n> -\texit 1\n> -}\n> -\n> -if [ $# -lt 4 ]; then\n> -\techo \"Error: Invalid argument count.\"\n> -\tusage\n> -fi\n> -\n> -src_dir=\"$1\"; shift\n> -build_path=\"$1\"; shift\n> -\n> -cat <<EOF > \"$build_path\"\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/* This file is auto-generated, do not edit! */\n> -\n> -#pragma once\n> -\n> -EOF\n> -\n> -cat <<EOF >> \"$build_path\"\n> -/*\n> - * List the names of the shaders at the top of\n> - * header for readability's sake\n> - *\n> -EOF\n> -\n> -for file in \"$@\"; do\n> -\tname=$(basename \"$file\" | tr '.' '_')\n> -\techo \"[SHADER-GEN] $name\"\n> -\techo \" * unsigned char $name;\" >> \"$build_path\"\n> -done\n> -\n> -echo \"*/\" >> \"$build_path\"\n> -\n> -echo \"/* Hex encoded shader data */\" >> \"$build_path\"\n> -for file in \"$@\"; do\n> -\tname=$(basename \"$file\")\n> -\t\"$src_dir/utils/gen-shader-header.py\" \"$name\" \"$file\" >> \"$build_path\"\n> -\techo >> \"$build_path\"\n> -done\n> diff --git a/utils/meson.build b/utils/meson.build\n> index 9c598793035c..17a7aa7c3f5e 100644\n> --- a/utils/meson.build\n> +++ b/utils/meson.build\n> @@ -3,7 +3,7 @@\n>   subdir('codegen')\n>   subdir('ipu3')\n>   \n> -gen_shader_headers = files('gen-shader-headers.sh')\n> +gen_shader_headers = files('gen-shader-headers.py')\n>   \n>   ## Module signing\n>   gen_ipa_priv_key = files('gen-ipa-priv-key.sh')\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>","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 A343AC3264\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Jun 2026 10:47:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 03BF565F6E;\n\tTue, 30 Jun 2026 12:47:27 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1DB72656D3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2026 12:47:24 +0200 (CEST)","from [192.168.33.31] (185.221.140.128.nat.pool.zt.hu\n\t[185.221.140.128])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3B374104C;\n\tTue, 30 Jun 2026 12:46:40 +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=\"uliPg6yF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1782816400;\n\tbh=cwx2TE/GiVHvmqXCxzxgLu9uqTLVnGB7zJYQ0Y2f514=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=uliPg6yFW5wmCOKJldm3rTt0O7Uixz0X89zpXE7kCxEBPeRG22gqPxdOW8GltGCix\n\tfNolkEIhz4Ku+UfNmFS9BXGe4Xa4E/+N0aZr2K/FMd8/p6FqGFWOrTdyMuUr8wFnti\n\td+LmESLpfTSbutasy+zhoPzcvg6HjqkYHIvkSWyw=","Message-ID":"<c4b2c800-8b3c-4d4d-9274-ee1ac07420ef@ideasonboard.com>","Date":"Tue, 30 Jun 2026 12:47:22 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","References":"<20260630083031.3197714-1-laurent.pinchart@ideasonboard.com>\n\t<20260630083031.3197714-3-laurent.pinchart@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260630083031.3197714-3-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>"}},{"id":39524,"web_url":"https://patchwork.libcamera.org/comment/39524/","msgid":"<20260630110336.GC3199975@killaraus.ideasonboard.com>","date":"2026-06-30T11:03:36","subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Jun 30, 2026 at 12:47:22PM +0200, Barnabás Pőcze wrote:\n> 2026. 06. 30. 10:30 keltezéssel, Laurent Pinchart írta:\n> > The shader header is generated by a combination of a shell script and a\n> > Python script. Simplify this by merging everything into a single script.\n> > \n> > The output of the old and new script only differ in white spaces.\n> > \n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >   src/libcamera/shaders/meson.build |  2 +-\n> >   utils/gen-shader-header.py        | 37 ----------------\n> >   utils/gen-shader-headers.py       | 71 +++++++++++++++++++++++++++++++\n> >   utils/gen-shader-headers.sh       | 54 -----------------------\n> >   utils/meson.build                 |  2 +-\n> >   5 files changed, 73 insertions(+), 93 deletions(-)\n> >   delete mode 100755 utils/gen-shader-header.py\n> >   create mode 100755 utils/gen-shader-headers.py\n> >   delete mode 100755 utils/gen-shader-headers.sh\n> > \n> > diff --git a/src/libcamera/shaders/meson.build b/src/libcamera/shaders/meson.build\n> > index adac77327a3b..4f4e8da607c7 100644\n> > --- a/src/libcamera/shaders/meson.build\n> > +++ b/src/libcamera/shaders/meson.build\n> > @@ -14,7 +14,7 @@ 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(), '@OUTPUT@', '@INPUT@'],\n> > +    command : [gen_shader_headers, '-o', '@OUTPUT@', '@INPUT@'],\n> >   )\n> >   \n> >   libcamera_internal_headers += libcamera_shader_headers\n> > diff --git a/utils/gen-shader-header.py b/utils/gen-shader-header.py\n> > deleted file mode 100755\n> > index 745852b4c03f..000000000000\n> > --- a/utils/gen-shader-header.py\n> > +++ /dev/null\n> > @@ -1,37 +0,0 @@\n> > -#!/usr/bin/env python3\n> > -# SPDX-License-Identifier: GPL-2.0-or-later\n> > -# Copyright (C) 2025, Bryan O'Donoghue.\n> > -#\n> > -# Author: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> > -#\n> > -# A Python script which takes a list of shader files and converts each of them\n> > -# into a C header.\n> > -#\n> > -import sys\n> > -\n> > -try:\n> > -    with open(sys.argv[2], \"rb\") as file:\n> > -        data = file.read()\n> > -        data_len = len(data)\n> > -\n> > -        name = sys.argv[1].replace(\".\", \"_\")\n> > -        name_len = name + \"_len\"\n> > -\n> > -        j = 0\n> > -        print(\"unsigned char const\", name, \"[] = {\")\n> > -        for ch in data:\n> > -            print(f\"0x{ch:02x}, \", end=\"\")\n> > -            j = (j + 1) % 16\n> > -            if j == 0:\n> > -                print()\n> > -        if j != 0:\n> > -            print()\n> > -        print(\"};\")\n> > -\n> > -        print()\n> > -        print(f\"const unsigned int {name_len}={data_len};\")\n> > -\n> > -except FileNotFoundError:\n> > -    print(f\"File {sys.argv[2]} not found\", file=sys.stderr)\n> > -except IOError:\n> > -    print(f\"Unable to read {sys.argv[2]}\", file=sys.stderr)\n> > diff --git a/utils/gen-shader-headers.py b/utils/gen-shader-headers.py\n> > new file mode 100755\n> > index 000000000000..908217a2bd2e\n> > --- /dev/null\n> > +++ b/utils/gen-shader-headers.py\n> > @@ -0,0 +1,71 @@\n> > +#!/usr/bin/env python3\n> > +# SPDX-License-Identifier: GPL-2.0-or-later\n> > +#\n> > +# Copyright (C) 2025, Bryan O'Donoghue\n> > +# Copyright (C) 2026, Ideas on Board Oy\n> > +#\n> > +# Generate a C header file containing hex-encoded shader sources\n> > +\n> > +import argparse\n> > +import binascii\n> > +import math\n> > +import os\n> > +import sys\n> > +\n> > +\n> > +def process_file(name, out):\n> > +    data = open(name, 'rb').read()\n> > +\n> > +    hex_data = [f'0x{c:02x}' for c in data]\n> > +    var_name = os.path.basename(name).replace('.', '_')\n> > +\n> > +    out.write(f'unsigned char const {var_name}[] = {{\\n')\n> > +\n> > +    for i in range(math.ceil(len(data) / 16)):\n> \n> I wanted to suggest `itertools.batched()`, but I am afraid that is too new (python 3.12).\n\nIndeed, but thanks for the suggestion. I didn't know about it.\n\n> > +        out.write('\\t')\n> > +        out.write(', '.join(hex_data[16 * i:16 * (i + 1)]))\n> > +        out.write(',\\n')\n> > +\n> > +    out.write('};\\n\\n')\n> > +    out.write(f'const unsigned int {var_name}_len = {len(data)};\\n')\n> > +\n> > +\n> > +def main(argv):\n> > +    parser = argparse.ArgumentParser(\n> > +        description='Generate a C header file containing hex-encoded shader sources')\n> > +    parser.add_argument('--output', '-o', metavar='file', default=sys.stdout,\n> > +                        type=argparse.FileType('w', encoding='utf-8'),\n> > +                        help='Output file name. Defaults to standard output if not specified.')\n> > +    parser.add_argument('input', nargs='+', type=str,\n> \n> Could be `type=pathlib.Path` to avoid `os.path` stuff.\n\nI'll give that a try.\n\n> > +                        help='Input file names.')\n> > +    args = parser.parse_args(argv[1:])\n> > +\n> > +    args.output.write('''/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> \n> args.output.write(\n> '''\\\n> /* SPDX-License-Identifier: LGPL-2.1-or-later */\n> \n> is an option to avoid having the first line be indented.\n\nOK.\n\nManual string manipulation isn't nice. I considered using jinja2\ntemplates, but decided it wasn't worth the hassle.\n\n> > +/* This file is auto-generated, do not edit! */\n> > +\n> > +#pragma once\n> > +\n> > +/*\n> > + * List the names of the shaders at the top of header for readability's sake.\n> > + *\n> > +''')\n> > +\n> > +    for name in args.input:\n> > +        name = os.path.basename(name).replace('.', '_')\n> > +        args.output.write(f' * unsigned char {name};\\n')\n> \n> I think the \"unsigned char\" part should be removed.\n\nI think so too, I'll do it in a separate patch as I wanted to minimize\nthe impact on the generated header here.\n\n> > +\n> > +    args.output.write(''' */\n> > +\n> > +/* Hex encoded shader data */\n> > +''')\n> > +\n> > +    for name in args.input:\n> > +        process_file(name, args.output)\n> > +        args.output.write('\\n')\n> > +\n> > +    return 0\n> > +\n> > +\n> > +if __name__ == '__main__':\n> > +    sys.exit(main(sys.argv))\n> > +\n> > diff --git a/utils/gen-shader-headers.sh b/utils/gen-shader-headers.sh\n> > deleted file mode 100755\n> > index 0d6649521a7a..000000000000\n> > --- a/utils/gen-shader-headers.sh\n> > +++ /dev/null\n> > @@ -1,54 +0,0 @@\n> > -#!/bin/sh\n> > -# SPDX-License-Identifier: GPL-2.0-or-later\n> > -\n> > -set -e\n> > -\n> > -usage() {\n> > -\techo \"Usage: $0 <src_dir> <output_header> <shader_file1> [shader_file2 ...]\"\n> > -\techo\n> > -\techo \"Generates a C header file containing hex-encoded shader data.\"\n> > -\techo\n> > -\techo \"Arguments:\"\n> > -\techo \"  src_dir             Path to the base of the source directory\"\n> > -\techo \"  output_header       Path to the generated header file\"\n> > -\techo \"  shader_file(s)      One or more shader files to embed in the header\"\n> > -\texit 1\n> > -}\n> > -\n> > -if [ $# -lt 4 ]; then\n> > -\techo \"Error: Invalid argument count.\"\n> > -\tusage\n> > -fi\n> > -\n> > -src_dir=\"$1\"; shift\n> > -build_path=\"$1\"; shift\n> > -\n> > -cat <<EOF > \"$build_path\"\n> > -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> > -/* This file is auto-generated, do not edit! */\n> > -\n> > -#pragma once\n> > -\n> > -EOF\n> > -\n> > -cat <<EOF >> \"$build_path\"\n> > -/*\n> > - * List the names of the shaders at the top of\n> > - * header for readability's sake\n> > - *\n> > -EOF\n> > -\n> > -for file in \"$@\"; do\n> > -\tname=$(basename \"$file\" | tr '.' '_')\n> > -\techo \"[SHADER-GEN] $name\"\n> > -\techo \" * unsigned char $name;\" >> \"$build_path\"\n> > -done\n> > -\n> > -echo \"*/\" >> \"$build_path\"\n> > -\n> > -echo \"/* Hex encoded shader data */\" >> \"$build_path\"\n> > -for file in \"$@\"; do\n> > -\tname=$(basename \"$file\")\n> > -\t\"$src_dir/utils/gen-shader-header.py\" \"$name\" \"$file\" >> \"$build_path\"\n> > -\techo >> \"$build_path\"\n> > -done\n> > diff --git a/utils/meson.build b/utils/meson.build\n> > index 9c598793035c..17a7aa7c3f5e 100644\n> > --- a/utils/meson.build\n> > +++ b/utils/meson.build\n> > @@ -3,7 +3,7 @@\n> >   subdir('codegen')\n> >   subdir('ipu3')\n> >   \n> > -gen_shader_headers = files('gen-shader-headers.sh')\n> > +gen_shader_headers = files('gen-shader-headers.py')\n> >   \n> >   ## Module signing\n> >   gen_ipa_priv_key = files('gen-ipa-priv-key.sh')\n> \n> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>","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 56192C3261\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Jun 2026 11:03:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 798CC65F6D;\n\tTue, 30 Jun 2026 13:03:40 +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 67E1B65F55\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2026 13:03:38 +0200 (CEST)","from killaraus.ideasonboard.com\n\t(2001-14ba-70f3-e800--a06.rev.dnainternet.fi\n\t[IPv6:2001:14ba:70f3:e800::a06])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5DD0922B;\n\tTue, 30 Jun 2026 13:02:54 +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=\"JOSPjiyB\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1782817374;\n\tbh=JsVityItjFTTKtIm3UkCuLY2LXy+GA9bLEz2c5bVXB4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=JOSPjiyBQjbydMhCl62YJcxs6LSYsvMA9vEV9UxQS1jkGw1Q3LWlAf9zRjkJgdquH\n\tQWAqczOMrHCnSAwTweXNEwED21ZWjb1jWBWT7cLE7BWRDzngL+qpJXGJujb0mi4K7d\n\ta7CSzXA2WPfnG+SD8nAqAdzMzRPcG+LAawoPsc9k=","Date":"Tue, 30 Jun 2026 14:03:36 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>","Subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","Message-ID":"<20260630110336.GC3199975@killaraus.ideasonboard.com>","References":"<20260630083031.3197714-1-laurent.pinchart@ideasonboard.com>\n\t<20260630083031.3197714-3-laurent.pinchart@ideasonboard.com>\n\t<c4b2c800-8b3c-4d4d-9274-ee1ac07420ef@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<c4b2c800-8b3c-4d4d-9274-ee1ac07420ef@ideasonboard.com>","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>"}},{"id":39529,"web_url":"https://patchwork.libcamera.org/comment/39529/","msgid":"<504ab371-f63a-42fb-8ee6-e47f765662d2@linaro.org>","date":"2026-06-30T11:49:49","subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/people/175/","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"content":"On 30/06/2026 09:30, Laurent Pinchart wrote:\n> -    command : [gen_shader_headers, meson.project_source_root(), '@OUTPUT@', '@INPUT@'],\n> +    command : [gen_shader_headers, '-o', '@OUTPUT@', '@INPUT@'],\n\nI'm not a meson exprt, this was genuinely my first time wring meson \nstuff - as I recall though meson.project_source_root() fixed an issue \nfor me where instead of say `meson setup build` it was `meson setup \nbuilds/somebuild`\n\nDoes your series survive moving to a sub-directory as above ?\n\n---\nbod","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 9700FC3303\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Jun 2026 11:49:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C18FC65F66;\n\tTue, 30 Jun 2026 13:49:52 +0200 (CEST)","from mail-wm1-x333.google.com (mail-wm1-x333.google.com\n\t[IPv6:2a00:1450:4864:20::333])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7431861F3F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2026 13:49:51 +0200 (CEST)","by mail-wm1-x333.google.com with SMTP id\n\t5b1f17b1804b1-490b1bbcf3aso22496115e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2026 04:49:51 -0700 (PDT)","from [192.168.0.101] ([109.76.103.114])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-493b8caff4csm66821325e9.12.2026.06.30.04.49.50\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tTue, 30 Jun 2026 04:49:50 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"TSJHCyx7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1782820191; x=1783424991;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:in-reply-to:content-language:from\n\t:references:to:subject:user-agent:mime-version:date:message-id:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=UekLSI3752aZS9utAvE7tZYgnMQcP6gSxaRmU1L6tmI=;\n\tb=TSJHCyx7SOMVKkzxrzjSqIureY4ORBfmsGNqfF3luOj0TnS41PoOdhXuASKfCgz+KD\n\to+lRLSb5x10dsdldvbCruk9q3fHpxLMkm96qUGIIqP3fvnpkAhd+NURzj0SfraZB5iKo\n\tGjEVWD8lmOWiwGgjoH1ABPln1rOZwAgwpUS8Uggvbi5vRZQqBEbDUSSG6+ofZpOl2PY2\n\tysaqUHgBWT5LDB9fE7dUFidSM9IoVQoSrkCT7QpybsW0/+P7pKdehHw01xzbdnupYbID\n\tN7l+aObuqUBWiz6wcTbF74QwXgj1XZSG8bhbi6UiIZyAuy3r5WCmDzDNGHO4h6NUwCaB\n\tBizA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1782820191; x=1783424991;\n\th=content-transfer-encoding:in-reply-to:content-language:from\n\t:references:to:subject:user-agent:mime-version:date:message-id\n\t:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=UekLSI3752aZS9utAvE7tZYgnMQcP6gSxaRmU1L6tmI=;\n\tb=BzjXBlx3X/iQUlKHN5F/WX1KpjlfgLiNr81KF/ttmL1n24siOkUnEHrN6TEq63DT47\n\tKhkF/owg1JQ4tlluDUPZGA+ucV6wDtsX1b41edz/YCcAtzVHA8NtX2u5A60gNZfQo1rE\n\tH47TSZ9pUmH5AWFdJXr9XJPJ5FZjxnQ6uGPYBLmJ4rkCNl22dLznoy8JbUBGBOWyQh/M\n\thUbwLOxkUwJd+osg0xCqWyArnccCW/XRVJmN+K322aaIljqTEARsUDPBU7Sja5Sw1t67\n\tSdGHiJYVa3bbNvRF52WnqOINeM89n3kMlKu2q4538W2aRlafpDrQgozyG+0IiuVCG1kX\n\tcPoA==","X-Forwarded-Encrypted":"i=1;\n\tAFNElJ9acwE6PSHj9CbxiErN6tpXcQ2LQmMbGtvwAXJiHRplE7hJ6V2BE7ptw5vjMSC4o0Ctvu+llx99SQPL3De8U9I=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YyjWh5C+BntcJEqWCIsQTLvDl5vRBceUCayjQlQlpqUa7ZOwW6Z\n\tOpijQb9XDWHSo84ZRBva1ingJWrJFh6g+ahJoc5mVTZI8PtBZ4+Z1QdG89KedHBEIx4=","X-Gm-Gg":"AfdE7clVDE7X9LmZGcXwAtno5wRB8G00Z0A5li6/LqtuJq0dAro3osqFPdoL21z6+/T\n\tdjfrq9vtfm/gNzJ7vbpZgKVO1EcWsBW36Q9BV1vTR4lwllmIMsMCVteaumvBqqsCXmU/2Zw8sH6\n\tov/BHBJ2u8jAz1wqNKjKiLQnHzL5sySFoSG4FqBiBjIZBQVsSbA2op1G2Su7ylNhsCB5Jb9mZJC\n\tGzEtzNVBJweriyRv5ASXaVo3al9dYvL8biayZei9pgotnZi173HxjYw6Ig2YSt3oYIoI4Z4bvUp\n\tUr3P0h6eEHBmisEBesyCOzKyX+4Xj9PfUnq49Ui77wylqeRsIQ8QZXBaeJueTFjsiap+Rvgu8PC\n\tsWTINXYqgK3CAlAzOOwAhaJj2CruI8x48mgIXvZDg69Xs8Jok77Z1uOMH2UFyW7mFg0hmpnSQ/+\n\tvsVUHWF0w6K3ys2+jVfzAiYx5+mxULj5bMzmR2","X-Received":"by 2002:a05:600c:8b12:b0:492:32f3:a344 with SMTP id\n\t5b1f17b1804b1-493b82b61b4mr47326645e9.31.1782820190887; \n\tTue, 30 Jun 2026 04:49:50 -0700 (PDT)","Message-ID":"<504ab371-f63a-42fb-8ee6-e47f765662d2@linaro.org>","Date":"Tue, 30 Jun 2026 12:49:49 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260630083031.3197714-1-laurent.pinchart@ideasonboard.com>\n\t<20260630083031.3197714-3-laurent.pinchart@ideasonboard.com>","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Content-Language":"en-US","In-Reply-To":"<20260630083031.3197714-3-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}},{"id":39531,"web_url":"https://patchwork.libcamera.org/comment/39531/","msgid":"<20260630120435.GE3199975@killaraus.ideasonboard.com>","date":"2026-06-30T12:04:35","subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Jun 30, 2026 at 12:49:49PM +0100, Bryan O'Donoghue wrote:\n> On 30/06/2026 09:30, Laurent Pinchart wrote:\n> > -    command : [gen_shader_headers, meson.project_source_root(), '@OUTPUT@', '@INPUT@'],\n> > +    command : [gen_shader_headers, '-o', '@OUTPUT@', '@INPUT@'],\n> \n> I'm not a meson exprt, this was genuinely my first time wring meson \n> stuff - as I recall though meson.project_source_root() fixed an issue \n> for me where instead of say `meson setup build` it was `meson setup \n> builds/somebuild`\n> \n> Does your series survive moving to a sub-directory as above ?\n\nIt does, I also build in build/something/.","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 B0612C3261\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Jun 2026 12:04:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CF2A465F69;\n\tTue, 30 Jun 2026 14:04:38 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5486165F55\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2026 14:04:37 +0200 (CEST)","from killaraus.ideasonboard.com\n\t(2001-14ba-70f3-e800--a06.rev.dnainternet.fi\n\t[IPv6:2001:14ba:70f3:e800::a06])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3E2F0D52;\n\tTue, 30 Jun 2026 14:03:53 +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=\"L6QKIb/i\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1782821033;\n\tbh=oHNi7NUa2bSVlAumMSSEqdXQW620xy1pskBovkOIhtE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=L6QKIb/ibRbJD3oF4f+DYdDYhCbtzXdCrTITL6n4FOP66u4fuuxmq1+TxVcBMGIBq\n\tBcnMNNYKYgvxp8+lIhA7bFuqAioK3OpF2ntXgaqFw4/eXWbV+GCTfu71mdRqmSwuEQ\n\t8++rzaI709VFwyimdVJiNDUcHCRBhmWWioes/bmg=","Date":"Tue, 30 Jun 2026 15:04:35 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","Message-ID":"<20260630120435.GE3199975@killaraus.ideasonboard.com>","References":"<20260630083031.3197714-1-laurent.pinchart@ideasonboard.com>\n\t<20260630083031.3197714-3-laurent.pinchart@ideasonboard.com>\n\t<504ab371-f63a-42fb-8ee6-e47f765662d2@linaro.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<504ab371-f63a-42fb-8ee6-e47f765662d2@linaro.org>","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>"}},{"id":39534,"web_url":"https://patchwork.libcamera.org/comment/39534/","msgid":"<795fbfa5-e284-406d-9cdd-4dc416ef3642@linaro.org>","date":"2026-06-30T12:27:10","subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/people/175/","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"content":"On 30/06/2026 09:30, Laurent Pinchart wrote:\n> The shader header is generated by a combination of a shell script and a\n> Python script. Simplify this by merging everything into a single script.\n> \n> The output of the old and new script only differ in white spaces.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n\n---\nbod","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 3CF20C3261\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Jun 2026 12:27:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 330D965F6A;\n\tTue, 30 Jun 2026 14:27:13 +0200 (CEST)","from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com\n\t[IPv6:2a00:1450:4864:20::32c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2679365F55\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2026 14:27:12 +0200 (CEST)","by mail-wm1-x32c.google.com with SMTP id\n\t5b1f17b1804b1-493b779003fso5826535e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2026 05:27:12 -0700 (PDT)","from [192.168.0.101] ([109.76.103.114])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-493b8cd303csm63866705e9.6.2026.06.30.05.27.10\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tTue, 30 Jun 2026 05:27:11 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"iip8wN43\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1782822431; x=1783427231;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:in-reply-to:content-language:from\n\t:references:to:subject:user-agent:mime-version:date:message-id:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=19Kw2V+sSiJLO3yHIFJUPdx0/d7QnTKCZoBZvgiEt6o=;\n\tb=iip8wN43ZJs8Z/KAgVkQw1Mj5oAOeQefrdd1sGixPXfSa47o4E/jON5kYN+7/QBzZh\n\tI6+sIf9ymwPkFwUsFOTFpChTlmv09iI5OBosWeukYef2rJ2qEYRa1V+ZXVZwCNpk4Qmc\n\tQusUZHfkFA8cD6t+fmfCcX2lnhmYAW1e3w8uHnKF3DQjQUDygWEt8N0D5rcVE66GBQUK\n\tyb8SvvJXpZpC4CA9MPjM3U3/OgJZaokPM3cUB2MsBAhfHDAKTwc6wLXZpMEyfyyqV8/v\n\tXDX/+aUKGhNFH0onqWtbQHewh8e+j7iFk046AYdDJAmtyZk8DSYcVWlEqDlBE74+By6m\n\ttEtw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1782822431; x=1783427231;\n\th=content-transfer-encoding:in-reply-to:content-language:from\n\t:references:to:subject:user-agent:mime-version:date:message-id\n\t:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=19Kw2V+sSiJLO3yHIFJUPdx0/d7QnTKCZoBZvgiEt6o=;\n\tb=pQ7uSAH7pR2C4s/Tjq9b/Q86lEzrarHmb8HhVizgVvEdvAtymIqfIyRMy2R3ZHfs5O\n\tw/KWE5+YKJYXl6Sg+JJ87S2IGHCDaeW/cpcBjuJPhQUcFhMsoEW+ZHId2sGps08O4/at\n\tTOrb67/aJJpunSa3QxxqYxsxcoTidqXazC38neXaXmw6Oa6Tz6TI8+7eG7rvn/2i50md\n\tXjE0YDxKoJD8ru0slYKoWwuMjqRwERlNqeGBLGCG8v6c7Zjm5054e4Nz2Kp8X4h07kXs\n\tSRN8cxdL2/tyiBuTjrUPecle2TzroM95BiO7T4XtBThq4MWQwHxte1zTbl9KAFx7vQfG\n\t3xKA==","X-Forwarded-Encrypted":"i=1;\n\tAFNElJ8/OaEGewCtuny6iXuDJquBfKH5wjVaOw8KP/WkAqbkZZpZxJNYMk5D8Kwk+0SuCTHXsg90XgAV7eBUe3vcnDg=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YxKdmMHzY66rGVuJkIa8gSAPp3I2SxBNaTKClgkGsMesni1Fj+S\n\t9EjvJQti4+Q+QIBKCS1OEM/F1JOaG04K2sQpkLJPuecKa/9siEBWEd6DwtrcgRGhV3s=","X-Gm-Gg":"AfdE7cndMBCzFR6gRHxDLK0i3RjDOojs0FuKOXUZsYJyCPCjSoZrjoIHHO30dq66UAi\n\t+FJxHd7Y/C5Le4K9KwFBXFv/pC0gbvTOrI9JFIunAxaLRiYuDuNZKmA3LRPSDE20SHDFzox+oZj\n\tnavgj5HiVgtJhM0D+OmoUCi1r89R5W/C1trkbQTilAS+W47evO4Up2AFLLqV8Bh/JL9+/RKvLKs\n\t8jctNzAMPGgJ6iLWUCXX8GXgmGUK2mS7MexgPM+c4QR8zrL1kjPYIeNVr8+ZtOEZvpwpwWeCboQ\n\tq127w9j74b8fV1PQcHkFRVGjzxcohhlQw7gvQvyYzI90nlrO+Vvcb6fzImuYzojNWZuCS3EPY3U\n\tjJZw/xx2P3Xc1s9wlspHdBXEuObXAt6yKVekNrKNdZiPOtP5R+vEeYeQr6z0K/21Tkzqm5ZUfae\n\tmoKd+mPs631LVNGr3n4h058V9yxQ==","X-Received":"by 2002:a05:600c:a317:b0:493:ae5d:8c40 with SMTP id\n\t5b1f17b1804b1-493b82b63c2mr50023595e9.27.1782822431579; \n\tTue, 30 Jun 2026 05:27:11 -0700 (PDT)","Message-ID":"<795fbfa5-e284-406d-9cdd-4dc416ef3642@linaro.org>","Date":"Tue, 30 Jun 2026 13:27:10 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/4] utils: Merge shader header generation scripts","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260630083031.3197714-1-laurent.pinchart@ideasonboard.com>\n\t<20260630083031.3197714-3-laurent.pinchart@ideasonboard.com>","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Content-Language":"en-US","In-Reply-To":"<20260630083031.3197714-3-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}}]