[{"id":39707,"web_url":"https://patchwork.libcamera.org/comment/39707/","msgid":"<05cff30f-bd3d-4b3d-a3d3-702ab95541bb@nxsw.ie>","date":"2026-07-15T00:35:40","subject":"Re: [RFC PATCH v7 4/6] libcamera: shaders: Add LSC support","submitter":{"id":226,"url":"https://patchwork.libcamera.org/api/people/226/","name":"Bryan O'Donoghue","email":"bod.linux@nxsw.ie"},"content":"On 08/07/2026 21:18, Milan Zamazal wrote:\n> +#if defined(APPLY_LSC)\n> +        if (lsc_enabled)\n> +                rgb = rgb * texture2D(lsc_tex, textureOut).rgb;\n> +#endif\n\nYou definitely don't need the define and the bool.\n\nI'd stick to the define - the CPU side can decide whether or not to pass \nthe define based on the bool.\n\nThe additional uniform is redundant.\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 29477C32CE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jul 2026 00:35:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 19BB76615B;\n\tWed, 15 Jul 2026 02:35:46 +0200 (CEST)","from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D2E4566152\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2026 02:35:44 +0200 (CEST)","from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])\n\tby tor.source.kernel.org (Postfix) with ESMTP id 5CF57601C6;\n\tWed, 15 Jul 2026 00:35:43 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id BA5931F000E9;\n\tWed, 15 Jul 2026 00:35:41 +0000 (UTC)"],"Message-ID":"<05cff30f-bd3d-4b3d-a3d3-702ab95541bb@nxsw.ie>","Date":"Wed, 15 Jul 2026 01:35:40 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v7 4/6] libcamera: shaders: Add LSC support","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"Xander Pronk <xander.c.pronk@gmail.com>,\n\tHans de Goede <johannes.goede@oss.qualcomm.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tRick ten Wolde <rick_libcamera@wolde.info>","References":"<20260708201816.299983-1-mzamazal@redhat.com>\n\t<Ny-CZ7R7Qyq1TeRCQ43Yg6NGN6F-Ohj1-YcJRcVArlBtjsr8I_UYxvoFd7IhkR5rEFv771trXjEvLTfIf3UBig==@protonmail.internalid>\n\t<20260708201816.299983-5-mzamazal@redhat.com>","From":"Bryan O'Donoghue <bod.linux@nxsw.ie>","Content-Language":"en-GB","In-Reply-To":"<20260708201816.299983-5-mzamazal@redhat.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":39708,"web_url":"https://patchwork.libcamera.org/comment/39708/","msgid":"<00381e74-dc5a-492b-9afd-01208d787f3f@nxsw.ie>","date":"2026-07-15T00:38:37","subject":"Re: [RFC PATCH v7 4/6] libcamera: shaders: Add LSC support","submitter":{"id":226,"url":"https://patchwork.libcamera.org/api/people/226/","name":"Bryan O'Donoghue","email":"bod.linux@nxsw.ie"},"content":"On 15/07/2026 01:35, Bryan O'Donoghue wrote:\n> On 08/07/2026 21:18, Milan Zamazal wrote:\n>> +#if defined(APPLY_LSC)\n>> +        if (lsc_enabled)\n>> +                rgb = rgb * texture2D(lsc_tex, textureOut).rgb;\n>> +#endif\n> \n> You definitely don't need the define and the bool.\n> \n> I'd stick to the define - the CPU side can decide whether or not to pass\n> the define based on the bool.\n> \n> The additional uniform is redundant.\n> \n> ---\n> bod\n\nUnless there's a real/realistic use-case of having a control switch LSC \non/off during runtime.\n\nIn which case - just the bool should be sufficient - again on the CPU \nside you would just not bother updating or creating the LSC texture if \nthe bool is false.\n\nI don't see that both are needed even for opportunistic runtime control \ntoggling. The bool on its own should be enough.\n\n---\nbod*2","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 3AFF2C32CE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jul 2026 00:38:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5248366166;\n\tWed, 15 Jul 2026 02:38:43 +0200 (CEST)","from sea.source.kernel.org (sea.source.kernel.org\n\t[IPv6:2600:3c0a:e001:78e:0:1991:8:25])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C536E66154\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2026 02:38:41 +0200 (CEST)","from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])\n\tby sea.source.kernel.org (Postfix) with ESMTP id E97FB42AAE;\n\tWed, 15 Jul 2026 00:38:39 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id A680F1F000E9;\n\tWed, 15 Jul 2026 00:38:38 +0000 (UTC)"],"Message-ID":"<00381e74-dc5a-492b-9afd-01208d787f3f@nxsw.ie>","Date":"Wed, 15 Jul 2026 01:38:37 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v7 4/6] libcamera: shaders: Add LSC support","From":"Bryan O'Donoghue <bod.linux@nxsw.ie>","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"Xander Pronk <xander.c.pronk@gmail.com>,\n\tHans de Goede <johannes.goede@oss.qualcomm.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tRick ten Wolde <rick_libcamera@wolde.info>","References":"<20260708201816.299983-1-mzamazal@redhat.com>\n\t<Ny-CZ7R7Qyq1TeRCQ43Yg6NGN6F-Ohj1-YcJRcVArlBtjsr8I_UYxvoFd7IhkR5rEFv771trXjEvLTfIf3UBig==@protonmail.internalid>\n\t<20260708201816.299983-5-mzamazal@redhat.com>\n\t<2ynHlt7woBSP-hzRFa1PQcb4e5dMV5JwG-1BgRGnXoixg78ov7fZwFvEdUd_tmtsD9vuxWvFT0oCiRCEvlvulw==@protonmail.internalid>\n\t<05cff30f-bd3d-4b3d-a3d3-702ab95541bb@nxsw.ie>","Content-Language":"en-GB","In-Reply-To":"<05cff30f-bd3d-4b3d-a3d3-702ab95541bb@nxsw.ie>","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>","Reply-To":"Bryan O'Donoghue <bod.linux@nxsw.ie>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":39715,"web_url":"https://patchwork.libcamera.org/comment/39715/","msgid":"<85pl0omy2u.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-07-15T08:55:21","subject":"Re: [RFC PATCH v7 4/6] libcamera: shaders: Add LSC support","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Bryan O'Donoghue <bod.linux@nxsw.ie> writes:\n\n> On 15/07/2026 01:35, Bryan O'Donoghue wrote:\n>> On 08/07/2026 21:18, Milan Zamazal wrote:\n>>> +#if defined(APPLY_LSC)\n>\n>>> +        if (lsc_enabled)\n>>> +                rgb = rgb * texture2D(lsc_tex, textureOut).rgb;\n>>> +#endif\n>> You definitely don't need the define and the bool.\n>> I'd stick to the define - the CPU side can decide whether or not to pass\n>> the define based on the bool.\n>> The additional uniform is redundant.\n>> ---\n>> bod\n>\n> Unless there's a real/realistic use-case of having a control switch LSC on/off during runtime.\n\nlsc_enabled is a runtime switch; APPLY_LSC depends on whether LSC is\nenabled in the tuning file.\n\n> In which case - just the bool should be sufficient - again on the CPU side you would just not bother\n> updating or creating the LSC texture if the bool is false.\n\nAvoiding the texture was the idea behind keeping APPLY_LSC.  If it is\npossible and safe not to set the texture (it seems to work fine in my\nenvironment) then APPLY_LSC can be removed.\n\n> I don't see that both are needed even for opportunistic runtime control toggling. The bool on its own\n> should be enough.\n>\n> ---\n> bod*2","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 E87AAC3304\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jul 2026 08:55:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6344F66165;\n\tWed, 15 Jul 2026 10:55:30 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EA34D6614E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2026 10:55:27 +0200 (CEST)","from mail-wr1-f69.google.com (mail-wr1-f69.google.com\n\t[209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-246-9NPBRibINDSgiW8FkUPgqg-1; Wed, 15 Jul 2026 04:55:24 -0400","by mail-wr1-f69.google.com with SMTP id\n\tffacd0b85a97d-473941177b0so4231523f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2026 01:55:24 -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\tffacd0b85a97d-47f464c9cc3sm15240073f8f.35.2026.07.15.01.55.22\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 15 Jul 2026 01:55:22 -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=\"Gfol+1vd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1784105726;\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=VzT0CSmD9iMcMo5i+uecfKIR059OCZDSGilcyE5vSn4=;\n\tb=Gfol+1vd5DcLo5L0XgxcZSmAnmor5sJ3A1AdqAlKLYDVNRjYPcrhoJPTIXZjCraSZDLOZV\n\tj7+/9QqBHU9o7TsF54SUqFeFgTbBWMTgnmtbC1zZGX8hOdJefY4+xMYoVGWT4zuyDOGeUj\n\tiLPv9k32mPs0FTInEQusIt/P6WQziP8=","X-MC-Unique":"9NPBRibINDSgiW8FkUPgqg-1","X-Mimecast-MFC-AGG-ID":"9NPBRibINDSgiW8FkUPgqg_1784105723","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1784105723; x=1784710523;\n\th=content-type:mime-version:user-agent:message-id:date:references\n\t:in-reply-to:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to\n\t:cc:subject:date:message-id:reply-to:content-type;\n\tbh=VzT0CSmD9iMcMo5i+uecfKIR059OCZDSGilcyE5vSn4=;\n\tb=U5QuViTEhEhN6D9DyTSXcU8lcZrptan16DCefVN/RQKoBmYf+GoIi25lyE0PMo9/k/\n\t/S/K7IALOh0RVfE6KtQH/JrU6Abo4lMv8qnPz4pBzdrcotEb0LoIBsD6iMHGLM7K8Och\n\tNKR265FffoT8jF1t3HZse+ABtgrV/u+7DszmnoteFTSmYTcafniQ+VGbO4aA/LcGZ/v4\n\tv9syOI7qCbTpmU9fqKU6JOqk8WiF6Olkl07+VniDbrNGHxq2DMWKjEFGJzu0MEGzCV5w\n\ttuD1Kz1WU2WM30G/5kSBeRJQ+wfH455t9EoirDL8F5hgnjI+yoCyFeb7khaH9am1fD2q\n\tT7cg==","X-Gm-Message-State":"AOJu0YzkaqDLuCOVnQ8DRiSffzRNNThMDAspDDRjmRAWPSMb5qhnwtah\n\thUZzIh/Fs8TaSVK5U/ZiFUge7P1ZeeDQ4aBRJTzbwnZkY/O97F0ll3vT91RqB2LjtMxkj11vZks\n\tCam4Hhl6vCX39U+fo9X9tzO846EdWJKNYj6cfNICsDquT85mOS2VI5JRU4a30+9AwD2hk+PH/Iy\n\tI=","X-Gm-Gg":"AfdE7clEU3O0Neqs1dNnadNSIooP/GIiylVqY2zMAfZlxLDYD7KMqb3uPtQxXkeBuYV\n\tsr7USKNK427FjcJy3Er3QQOCzYGdsxKhexwWx73dsRemCxpbtC4Y1Dw3uZ6H7jf2fZliiAttVhy\n\tu6cZSwUJpfgapaTEdHLFVYhkXwUWkrBjspGlUZMWdHlmkHiga5mYlWJeKYK4k5cDli/rzv6am+c\n\tuj6qP+QInm4MuABk4l33hsltCUn5MHcK0h7nTWy/9foAX8ax/m24p3f4Ym7fSuXutrV8RryTEo5\n\tqQtqpv3FthjmoQXYjtmHb8V0DhGP0doQc6lrOZxJ36FsuHrmfeLz/9WGb6MVTUgh1mcJzTiH8Vw\n\t3IjgvBDR3D+uvkvCYeVStk4xgco9XDaT5u/LIx6krD8evI13tebBfhlRew+XHx1I/","X-Received":["by 2002:a05:6000:22c7:b0:47f:4fbf:7b21 with SMTP id\n\tffacd0b85a97d-47f4fcc8715mr2091932f8f.12.1784105723340; \n\tWed, 15 Jul 2026 01:55:23 -0700 (PDT)","by 2002:a05:6000:22c7:b0:47f:4fbf:7b21 with SMTP id\n\tffacd0b85a97d-47f4fcc8715mr2091903f8f.12.1784105723029; \n\tWed, 15 Jul 2026 01:55:23 -0700 (PDT)"],"From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bod.linux@nxsw.ie>","Cc":"libcamera-devel@lists.libcamera.org,  Xander Pronk\n\t<xander.c.pronk@gmail.com>,  Hans de Goede\n\t<johannes.goede@oss.qualcomm.com>,  Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>,  Rick ten Wolde\n\t<rick_libcamera@wolde.info>","Subject":"Re: [RFC PATCH v7 4/6] libcamera: shaders: Add LSC support","In-Reply-To":"<00381e74-dc5a-492b-9afd-01208d787f3f@nxsw.ie> (Bryan\n\tO'Donoghue's message of \"Wed, 15 Jul 2026 01:38:37 +0100\")","References":"<20260708201816.299983-1-mzamazal@redhat.com>\n\t<Ny-CZ7R7Qyq1TeRCQ43Yg6NGN6F-Ohj1-YcJRcVArlBtjsr8I_UYxvoFd7IhkR5rEFv771trXjEvLTfIf3UBig==@protonmail.internalid>\n\t<20260708201816.299983-5-mzamazal@redhat.com>\n\t<2ynHlt7woBSP-hzRFa1PQcb4e5dMV5JwG-1BgRGnXoixg78ov7fZwFvEdUd_tmtsD9vuxWvFT0oCiRCEvlvulw==@protonmail.internalid>\n\t<05cff30f-bd3d-4b3d-a3d3-702ab95541bb@nxsw.ie>\n\t<00381e74-dc5a-492b-9afd-01208d787f3f@nxsw.ie>","Date":"Wed, 15 Jul 2026 10:55:21 +0200","Message-ID":"<85pl0omy2u.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":"rdNckuvJmCtlJcc1g-cgEJnZOH5xxmde4SlrpiCdoiY_1784105723","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":39731,"web_url":"https://patchwork.libcamera.org/comment/39731/","msgid":"<85ik6gmfct.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-07-15T15:39:46","subject":"Re: [RFC PATCH v7 4/6] libcamera: shaders: Add LSC support","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Milan Zamazal <mzamazal@redhat.com> writes:\n\n> Bryan O'Donoghue <bod.linux@nxsw.ie> writes:\n>\n>> On 15/07/2026 01:35, Bryan O'Donoghue wrote:\n>>> On 08/07/2026 21:18, Milan Zamazal wrote:\n>>>> +#if defined(APPLY_LSC)\n>>\n>>>> +        if (lsc_enabled)\n>>>> +                rgb = rgb * texture2D(lsc_tex, textureOut).rgb;\n>>>> +#endif\n>>> You definitely don't need the define and the bool.\n>>> I'd stick to the define - the CPU side can decide whether or not to pass\n>>> the define based on the bool.\n>>> The additional uniform is redundant.\n>>> ---\n>>> bod\n>>\n>> Unless there's a real/realistic use-case of having a control switch LSC on/off during runtime.\n>\n> lsc_enabled is a runtime switch; APPLY_LSC depends on whether LSC is\n> enabled in the tuning file.\n>\n>> In which case - just the bool should be sufficient - again on the CPU side you would just not bother\n>> updating or creating the LSC texture if the bool is false.\n>\n> Avoiding the texture was the idea behind keeping APPLY_LSC.  If it is\n> possible and safe not to set the texture (it seems to work fine in my\n> environment) then APPLY_LSC can be removed.\n\nFor the track, as discussed at the meeting today: An agreement was to\nkeep APPLY_LSC and to remove lsc_enabled.  The rationale is that if LSC\nis enabled in the tuning file, there is hardly any reason to switch it\noff in runtime, except for demoing purposes or so.  Then the performance\npenalty caused by still performing LSC, with all 1.0 coefficients,\ndoesn't matter.  Having APPLY_LSC is still useful, to avoid the\nperformance penalty and all the LSC texture handling if LSC is not\nenabled at all.\n\nOut of curiosity, I measured how much overhead I get by the shader\nconditional and the LSC computation there in my environment:\n\n- lsc_enabled set to false: ~5% slower than with the computation removed\n  completely from the shader.\n\n- lsc_enabled set to true: ~15% slower than with the computation removed\n  completely from the shader.\n\n- The condition removed and performing the computation unconditionally:\n  additionally ~15% slower than the case with lsc_enabled set to true,\n  while the output is the same!  Very weird.  An LLM suggests register\n  pressure resulting in fewer concurrent threads, compared to the case\n  where the GPU must consider branching; maybe.\n\nThings can be different once rebased on multi-pass GPU, but I'm not\ngoing to do that until libipa rework is merged.\n\n>> I don't see that both are needed even for opportunistic runtime control toggling. The bool on its own\n>> should be enough.\n>>\n>> ---\n>> bod*2","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 7A909C3308\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jul 2026 15:39:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DAB5967E24;\n\tWed, 15 Jul 2026 17:39:54 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F7A667E15\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2026 17:39:52 +0200 (CEST)","from mail-wm1-f69.google.com (mail-wm1-f69.google.com\n\t[209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-6-qxRXzxqFPhiozWbwwk-__g-1; Wed, 15 Jul 2026 11:39:49 -0400","by mail-wm1-f69.google.com with SMTP id\n\t5b1f17b1804b1-490a767c7dcso42891465e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2026 08:39:49 -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\tffacd0b85a97d-47f4634e0e4sm18491633f8f.4.2026.07.15.08.39.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 15 Jul 2026 08:39:46 -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=\"DxWh6oUL\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1784129991;\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=DQzat8c6yC3uap+8FuewpwqewRoA2ybq1F1t+7NG0cY=;\n\tb=DxWh6oULTyjYdxdv1PwXuPvxV1b2H1wx6PhoWwGVjf9dYAVGRFh4CW5eWD6rR9pzszRjV7\n\tR7G4jJBtUX+OXTD6AG6rQ5VadyXv1NMMfEeFPBmTtNytIXyc0jttJNS3HVBHnzI2uvfHiH\n\tax/GJs5xK8pSEwHp3CDafVM7CXl5FaA=","X-MC-Unique":"qxRXzxqFPhiozWbwwk-__g-1","X-Mimecast-MFC-AGG-ID":"qxRXzxqFPhiozWbwwk-__g_1784129988","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1784129988; x=1784734788;\n\th=content-type:mime-version:user-agent:message-id:date:references\n\t:in-reply-to:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to\n\t:cc:subject:date:message-id:reply-to:content-type;\n\tbh=DQzat8c6yC3uap+8FuewpwqewRoA2ybq1F1t+7NG0cY=;\n\tb=sXgB0n9jvw1lhWgTxnHa18JZmLnLhLF5UFDphtd5HTSmVTgvfzVuhlj1FD6GITATJs\n\t6Qk9U99xeUtSiHnN5tgERjqMXlQBsiasmbzEXfpZvzoF7aLSeB3tAD0a1xmv+RAmXOT7\n\t7ajRU1bXCb6PPWOhCW0QyG9OKj/UdGBqiEU9QZGBGzfr6DCH6CSzEqyFR6D9lwIJRASh\n\tNXr0yrUtVgc/Sf5ORSLPDujEoDRVNkOFCY13aLTSxRrVoDwW59vOiiCte6OfqBgvtygA\n\ttnD54ifLwgyYTCn1gPQpq1OGyevd7EW9LgGp+fXikyHXFzIhTMA/zRqNc58G3lcrl/77\n\td/Ug==","X-Gm-Message-State":"AOJu0YwKTG9uGvZF909hhJCNrzkuk/7UaRSiizgdFDgpNOL9Y703HqMV\n\t4J0BRNAxokiRiXOXay80FeRALYO4yUsv9kFJGCfN1l+n5ESKnJtyM67eHyyue5rWk81hLibEkrP\n\tV43eIa9BR4nNv9Ed6dhDL1UG/YuyjTsOAWy3lpjFbWCKg9ct4bf3K1rvMzbX/6Cia/VPQWq0pNT\n\tA=","X-Gm-Gg":"AfdE7cmLSAlLzNcbNZevSIgfPFsNK+ROpvclr02DsZ1aw3QGrtHMSEzNDZjTK+HsYkq\n\tyyn4Lk7/OTLrQWo3VSOgv5PixgmYET28Eo7Ry/dctGyr/z51WwOTZk+yuZLZqfFjfBvZoCwMcTM\n\t9wKflS+IlJA3xCp8DCH6RKdCbxtVpY5nh2twKMNr8y5+jeJ92FAy5sBahQ91emVu5oZLbwRfoAV\n\t5s3hjHwmBXiBp05FNev3hzJrqlz7eXfoOKP7ctnxIyLyANYhrP5a6mQ6D686fuzyIVG+Ozu1r4B\n\tRGPcr/O9tz3T9yNiwawpW8xbJQ6dnPftIb+z3vrZ/1V+16G6AM+QV7lKS8QVUdK2FgQhgI2VoTc\n\tGAU+0tPuZIc8J+CPoGffisHE6WFXOmquJqfmkwObXQoKQl/uVNgw9/Sg6rFMQ1NtG","X-Received":["by 2002:a05:600c:3547:b0:492:4e1c:120 with SMTP id\n\t5b1f17b1804b1-4953c280a09mr37313675e9.32.1784129988228; \n\tWed, 15 Jul 2026 08:39:48 -0700 (PDT)","by 2002:a05:600c:3547:b0:492:4e1c:120 with SMTP id\n\t5b1f17b1804b1-4953c280a09mr37313295e9.32.1784129987622; \n\tWed, 15 Jul 2026 08:39:47 -0700 (PDT)"],"From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bod.linux@nxsw.ie>","Cc":"libcamera-devel@lists.libcamera.org,  Xander Pronk\n\t<xander.c.pronk@gmail.com>,  Hans de Goede\n\t<johannes.goede@oss.qualcomm.com>,  Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>,  Rick ten Wolde\n\t<rick_libcamera@wolde.info>","Subject":"Re: [RFC PATCH v7 4/6] libcamera: shaders: Add LSC support","In-Reply-To":"<85pl0omy2u.fsf@mzamazal-thinkpadp1gen7.tpbc.csb> (Milan\n\tZamazal's message of \"Wed, 15 Jul 2026 10:55:21 +0200\")","References":"<20260708201816.299983-1-mzamazal@redhat.com>\n\t<Ny-CZ7R7Qyq1TeRCQ43Yg6NGN6F-Ohj1-YcJRcVArlBtjsr8I_UYxvoFd7IhkR5rEFv771trXjEvLTfIf3UBig==@protonmail.internalid>\n\t<20260708201816.299983-5-mzamazal@redhat.com>\n\t<2ynHlt7woBSP-hzRFa1PQcb4e5dMV5JwG-1BgRGnXoixg78ov7fZwFvEdUd_tmtsD9vuxWvFT0oCiRCEvlvulw==@protonmail.internalid>\n\t<05cff30f-bd3d-4b3d-a3d3-702ab95541bb@nxsw.ie>\n\t<00381e74-dc5a-492b-9afd-01208d787f3f@nxsw.ie>\n\t<85pl0omy2u.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","Date":"Wed, 15 Jul 2026 17:39:46 +0200","Message-ID":"<85ik6gmfct.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":"HO1Zjk3My50rw147kosaqSfWnQmgBf1haEZmjsNtY1o_1784129988","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>"}}]