{"id":25497,"url":"https://patchwork.libcamera.org/api/patches/25497/?format=json","web_url":"https://patchwork.libcamera.org/patch/25497/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20251211232246.31330-4-bryan.odonoghue@linaro.org>","date":"2025-12-11T23:22:28","name":"[v5,03/20] meson: Automatically generate glsl_shaders.h from specified shader programs","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"78bfd4997334c20c8a02b8d8be329e8c31927538","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/people/175/?format=json","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25497/mbox/","series":[{"id":5656,"url":"https://patchwork.libcamera.org/api/series/5656/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5656","date":"2025-12-11T23:22:25","name":"GPUISP precursor series","version":5,"mbox":"https://patchwork.libcamera.org/series/5656/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25497/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25497/checks/","tags":{},"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 CAB3EC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 11 Dec 2025 23:23:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7BAB16162B;\n\tFri, 12 Dec 2025 00:23:22 +0100 (CET)","from mail-pf1-x432.google.com (mail-pf1-x432.google.com\n\t[IPv6:2607:f8b0:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CB07F6161D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Dec 2025 00:23:20 +0100 (CET)","by mail-pf1-x432.google.com with SMTP id\n\td2e1a72fcca58-7aad4823079so605521b3a.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Dec 2025 15:23:20 -0800 (PST)","from inspiron14p-linux (M106185144161.v4.enabler.ne.jp.\n\t[106.185.144.161]) by smtp.gmail.com with ESMTPSA id\n\td2e1a72fcca58-7f4c4ab52aasm3399933b3a.38.2025.12.11.15.23.15\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 11 Dec 2025 15:23:18 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"SUW4lDOO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1765495399; x=1766100199;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=pQX41AGsNI0QCoqx36ezoVqFb8YAenUUt7bw97cItvQ=;\n\tb=SUW4lDOOjV60pZ0hOaq32pl6+5gm+E0BbLb9vHhs6AncLzT28Gtchx4hyqTeRpmfRF\n\tv7svnqEywVXTAvw+1oEgiOxPqkWIpJZcgyREdOQ8t8WCXB8YttIvhNxHI+FVBtnvO+79\n\t8/1o26YXt3Y+dp5J4/dvg0zr6b2AL312FKcI0/15Z59tMcU+93JuvjxRHFECtisJqtvJ\n\tEXMX9Y2E7EPod3Tv/TQn8VAHpfcfBYrQ4R3W2LrBxkom0C2mTZkXViM6DZG81FVauUIz\n\t4f0gstSw9wk/xNCUA2xPpADiZ0UcA5vMMgsWueo/X5njIDfK3D7o3HwBlFOPxa6hrgnI\n\toQKw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765495399; x=1766100199;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=pQX41AGsNI0QCoqx36ezoVqFb8YAenUUt7bw97cItvQ=;\n\tb=paBr95IxyhKPJJRhdA0ZyqZUkJcRxo6wW399ZZjq9wUbnsXQLj+ar7ZBAJ2IDsSgP4\n\tfiPy7r55YbsXUQFF9k5i2Sk20QunKqjbqbUom5lnOa+WQJt0tgKu46yLH2TxY6HwXPkX\n\tG61+ymYzJ0FoiDW/c8Cz7TgosPSnhXCq08oBNquZtDBDQVByZra4HyUM6tpSR1TpkYvL\n\tnaJCQdiLYRSd4PuoVxiZESCcj4/NZUpnoZawvw3in3GUDJTyJ0tQiWtBtCB5B9MtLS9w\n\tLetZhxdktb6fQymfNF829HNyQl639AKc0MLHEl3DtExqVGTPfZZdBeOy52t4G30o3rGE\n\tAiAw==","X-Gm-Message-State":"AOJu0YzodrkRyJUhFUoR754ZIZ0oDrv8vu/Rn3OCKw/mfw8Ig3H2tCFc\n\tj9I3PXLZPhKw6gjC7S2I8KIdHzD3y7/d+l1qb3IPsR6sGxY/7LvtBBayQ4hhRc2p9I8S8ApwDov\n\t/CCCP","X-Gm-Gg":"AY/fxX4TLhukCLgTtAS03ufIdOrDtJ7lO8SwxtAnAWXWDtnBVPINfzDeYqS1t4DBinh\n\t/7O7EUTZbEKF6V9fjWb8bVIOkwHMifbqePuSiXRCPNLvJUj8mN7Yq08EdOrhfh0iJKkJwa9Kbop\n\tzrMn1yZ0IncRU4Q8YrcV42DXKOrTh/tELjMntT+QBmenCQXjH7q+nU+ZSPLabxRJV8rLrNnBH5a\n\t9HlZzMzE74D/I80dJimyc6zzOu1a7aABiAx4ztW03/8rt8R4bmA3lqNGhVK1yqgWeYkPNxM8TGp\n\ta95OJO8T3eWvP7AmrDTfbA3bWETuetdj2EQeYMc4LNzMkw5vm0JF9zQSTYKHJuX5D6Jhr6+FcBy\n\tOQQlvDmb6y70DQWUcGvyTHD3UmW1BXrP75Z6NqH1LdQ7MvMAXoyFSgEj5/Lna2aRNRjrbLBnWp+\n\tSHByc9c0xTQcCZYlA4VUPc6pv8LJt/LvD1dYPmgBTGVJOfOH5eJSHbpcyOBZhSfg==","X-Google-Smtp-Source":"AGHT+IGI8ur9dGb+G09c5GWu15KRXefG9xW53I1tqXAJ5q9mYUuAmK9ROY1rUruq5VftY5cUzgLD4A==","X-Received":"by 2002:a05:6a00:414c:b0:7e8:4471:8db with SMTP id\n\td2e1a72fcca58-7f66a07d105mr171733b3a.60.1765495399145; \n\tThu, 11 Dec 2025 15:23:19 -0800 (PST)","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","To":"libcamera-devel@lists.libcamera.org","Cc":"pavel@ucw.cz, Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>","Subject":"[PATCH v5 03/20] meson: Automatically generate glsl_shaders.h from\n\tspecified shader programs","Date":"Thu, 11 Dec 2025 23:22:28 +0000","Message-ID":"<20251211232246.31330-4-bryan.odonoghue@linaro.org>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20251211232246.31330-1-bryan.odonoghue@linaro.org>","References":"<20251211232246.31330-1-bryan.odonoghue@linaro.org>","MIME-Version":"1.0","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>"},"content":"Encode the bayer shader files into a header as part of the build process.\nQcam already compiles the shader files down into a QT resource file which\nit references internally.\n\nIn order to share the debayering shader programs outside of qcam create a\ngeneric header which both qcam and libcamera can operate from.\n\nAcked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\nSigned-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n---\n src/libcamera/meson.build         | 11 +++++++++++\n src/libcamera/shaders/meson.build | 10 ++++++++++\n utils/meson.build                 |  2 ++\n 3 files changed, 23 insertions(+)\n create mode 100644 src/libcamera/shaders/meson.build","diff":"diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex 34e20f557..90d434a5a 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -76,6 +76,7 @@ subdir('ipa')\n subdir('pipeline')\n subdir('proxy')\n subdir('sensor')\n+subdir('shaders')\n subdir('software_isp')\n \n libdl = dependency('dl')\n@@ -182,6 +183,16 @@ libcamera_deps += [\n     libyaml,\n ]\n \n+# Generate headers from shaders\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 # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.\n # The build_rpath is stripped at install time by meson, so we determine at\n # runtime if the library is running from an installed location by checking\ndiff --git a/src/libcamera/shaders/meson.build b/src/libcamera/shaders/meson.build\nnew file mode 100644\nindex 000000000..386b342d0\n--- /dev/null\n+++ b/src/libcamera/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+])\ndiff --git a/utils/meson.build b/utils/meson.build\nindex 95d657ac9..3deed8ad4 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","prefixes":["v5","03/20"]}