{"id":25104,"url":"https://patchwork.libcamera.org/api/patches/25104/?format=json","web_url":"https://patchwork.libcamera.org/patch/25104/","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":"<20251120232019.3590-4-bryan.odonoghue@linaro.org>","date":"2025-11-20T23:20:00","name":"[03/22] meson: Automatically generate glsl_shaders.h from specified shader programs","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"315dfd48cde74cf55e53e006da1f91f24d8df561","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/25104/mbox/","series":[{"id":5599,"url":"https://patchwork.libcamera.org/api/series/5599/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5599","date":"2025-11-20T23:19:57","name":"GPUISP precursor series","version":1,"mbox":"https://patchwork.libcamera.org/series/5599/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25104/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25104/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 05A94C3330\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Nov 2025 23:20:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A4F6560A80;\n\tFri, 21 Nov 2025 00:20:34 +0100 (CET)","from mail-wr1-x430.google.com (mail-wr1-x430.google.com\n\t[IPv6:2a00:1450:4864:20::430])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0791660AA0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Nov 2025 00:20:31 +0100 (CET)","by mail-wr1-x430.google.com with SMTP id\n\tffacd0b85a97d-42b3b29153fso855282f8f.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Nov 2025 15:20:31 -0800 (PST)","from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie.\n\t[188.141.3.146]) by smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-477bf3af0ecsm11618415e9.9.2025.11.20.15.20.29\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 20 Nov 2025 15:20:29 -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=\"UcLbrEsq\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1763680830; x=1764285630;\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=AZjvy8VuhuGnPkiKZz0H2mspahrpuWL7zN2wdWyCmEw=;\n\tb=UcLbrEsqcTitFxSsVi/k/PyWh00i7oHYkbEyf1McAqh6zAnfFyuvHWkIi1goJhWuSZ\n\t1hHeiYVvgcB9SbLzEBiveoWNoWt9YaDrSct3dr3saAYacFUrS/FUkUTxdzhsmGkbjsuB\n\t8sg01M5ur9SfCAcNMsZ2QjPl+V7dheu4aVoWTqGzPLM36RrUkgHdVjeRUsZAb10byEGq\n\tV03A68nZfq+Jl6Yj7VcOZc2FLWFnALiDW9iAi1lgRxWUNF7BNKp76ewCEedY+ovkTCTR\n\twe0ZiFTLFXGBU3Hg5ZKltE3wrsIy6uWUC2VwbXwJb/3wBR8AOgLe4wcyMMMS0zNFHa1j\n\t84GQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1763680830; x=1764285630;\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=AZjvy8VuhuGnPkiKZz0H2mspahrpuWL7zN2wdWyCmEw=;\n\tb=X7Gf5d7h1zdaKYl0WoEzx3BE6+lI5MTI4u1btGggwQyW7b/notyHYYto8deIbjC4Ph\n\tTz42fYmuRkrtETQqz3cvk9qIspcGGyi71mPWjFamrL4M9JTsq76lMpjlE/VdC3fiXIjU\n\t24BUofKIYfKjcWoXo8gu+B+52XLvZhRZE8Dx+F5m4ibYzlmvm0lPnfjfzPkJ3aMEBd9x\n\tTaydDJ9CZyVg5MMqDnp1HWXNV/8OHRNfamG64iEzvczGsitQas5EPuTLLeqG5IRoruLm\n\t3zlMX3/VQnsl/vJeR4Py9FTFlVqsdh7PNMgyCcuhfQYpYo1pLeYABR/IfTZJe+80VhUp\n\tVgqA==","X-Gm-Message-State":"AOJu0YzoYXizqWHdD2bLeDESrNei2WFBEwJzHx8Af670z58yVj7KI09B\n\tjHdOHChYqX33Lk7M6oRiqVUoa3qoNzC/gbI8GQ9eK6SexkrOX/dLpq8wEZpcWMuPlCNdsZ7A0LY\n\tSONXW+9c=","X-Gm-Gg":"ASbGncvpLSzqFCnaIVrP6tH5401N2sr6ntPfTxmvTIH8N3stlStz06n9tYsv6WKPXLO\n\tfTckOAsWITWrDk5RvWCVIl4IYFfSIjFksEgeHL3Pzu+l+OFaj5wFIVvLtX3nTEw5vcoAIozPrKN\n\tZ83d1L6zM75317aaUUDgCjy0ekr0Bpib5du8oakHg9uejS4EgkiV4SJASdoJ/cm27sRbhe2IBa9\n\tkYuymZwCZZh4bOH9WfyKaE4QkK8Ln5BaFCP9bSSBklqIdkFO84i8hQbOMTqjW+81yLycdydP2Iq\n\t5GCRmexmvgt/yjOjZEySmH0dr9aYOvVCQx2Tlo7kE+CJpyOrbPrOEKFj2i0lKqW1f2LYJWxnLEn\n\tp+lG6i4VDTFaMu3VZ3vIq03rvnE5VK3qZfIQ8pu0DHVIN2G7SUAlKkh2TJE/oVYzNvCz9z6DuNJ\n\tSPDcfJR/j8t/eZ+TQM3eDllwYZ8C7yR0Ur0vcUaA+Ay4rpvcGjNbQVZS+2BQ0mxdl3w6Q=","X-Google-Smtp-Source":"AGHT+IFVaEdm+Z3bckYYenVRySGR41Y1lfOhCRDnHUpUwFFAdrlQuwIf2oP9IwyEUQyR5bDpUdLQfQ==","X-Received":"by 2002:a05:6000:601:b0:429:ca7f:8d5a with SMTP id\n\tffacd0b85a97d-42cc1d2e2e3mr58464f8f.37.1763680830298; \n\tThu, 20 Nov 2025 15:20:30 -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>","Subject":"[PATCH 03/22] meson: Automatically generate glsl_shaders.h from\n\tspecified shader programs","Date":"Thu, 20 Nov 2025 23:20:00 +0000","Message-ID":"<20251120232019.3590-4-bryan.odonoghue@linaro.org>","X-Mailer":"git-send-email 2.51.2","In-Reply-To":"<20251120232019.3590-1-bryan.odonoghue@linaro.org>","References":"<20251120232019.3590-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>\nSigned-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","diff":"diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build\nindex 45c299f6a..ecb7c9fa8 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')\ndiff --git a/include/libcamera/internal/shaders/meson.build b/include/libcamera/internal/shaders/meson.build\nnew file mode 100644\nindex 000000000..386b342d0\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+])\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":["03/22"]}