[{"id":39387,"web_url":"https://patchwork.libcamera.org/comment/39387/","msgid":"<50930950-548e-4df0-93ee-e71afb46f1ca@collabora.com>","date":"2026-06-24T12:17:46","subject":"Re: [PATCH 08/10] libcamera: software_isp: debayer_egl: Pass\n\teglImage as parameter to setShaderVariables","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"On 24.06.26 10:58, Bryan O'Donoghue wrote:\n> We will create a cache of textures and eGLImages which means the value\n> assigned to the shader texture unit will come from one of those now cached\n> eGLImage objects.\n>\n> Pass eGLImage as a parameter to facilitate future differentiation.\n>\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>   src/libcamera/software_isp/debayer_egl.cpp | 6 +++---\n>   src/libcamera/software_isp/debayer_egl.h   | 2 +-\n>   2 files changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\n> index cdceacf96..f6b7b11e1 100644\n> --- a/src/libcamera/software_isp/debayer_egl.cpp\n> +++ b/src/libcamera/software_isp/debayer_egl.cpp\n> @@ -397,7 +397,7 @@ uint32_t DebayerEGL::preferredInputStride(const PixelFormat &inputFormat, const\n>   \treturn info.stride(size.width, 0, 256);\n>   }\n>   \n> -void DebayerEGL::setShaderVariableValues(const DebayerParams &params)\n> +void DebayerEGL::setShaderVariableValues(eGLImage &eglImageIn, const DebayerParams &params)\n>   {\n>   \t/*\n>   \t * Raw Bayer 8-bit, and packed raw Bayer 10-bit/12-bit formats\n> @@ -453,7 +453,7 @@ void DebayerEGL::setShaderVariableValues(const DebayerParams &params)\n>   \t * To simultaneously sample multiple textures we need to use multiple\n>   \t * texture units\n>   \t */\n> -\tglUniform1i(textureUniformBayerDataIn_, eglImageBayerIn_->texture_unit_uniform_id_);\n> +\tglUniform1i(textureUniformBayerDataIn_, eglImageIn.texture_unit_uniform_id_);\n>   \n>   \t/*\n>   \t * These values are:\n> @@ -542,7 +542,7 @@ int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, const Debaye\n>   \t/* Generate the output render framebuffer as render to texture */\n>   \tegl_.createOutputDMABufTexture2D(*eglImageBayerOut_, output->planes()[0].fd.get());\n>   \n> -\tsetShaderVariableValues(params);\n> +\tsetShaderVariableValues(*eglImageBayerIn_, params);\n>   \tglViewport(0, 0, width_, height_);\n>   \tglClear(GL_COLOR_BUFFER_BIT);\n>   \tglDrawArrays(GL_TRIANGLE_FAN, 0, DEBAYER_OPENGL_COORDS);\n> diff --git a/src/libcamera/software_isp/debayer_egl.h b/src/libcamera/software_isp/debayer_egl.h\n> index 4c7c86472..348d7305b 100644\n> --- a/src/libcamera/software_isp/debayer_egl.h\n> +++ b/src/libcamera/software_isp/debayer_egl.h\n> @@ -65,7 +65,7 @@ private:\n>   \tstatic int getOutputConfig(PixelFormat outputFormat, DebayerOutputConfig &config);\n>   \tint initBayerShaders(PixelFormat inputFormat, PixelFormat outputFormat);\n>   \tint getShaderVariableLocations();\n> -\tvoid setShaderVariableValues(const DebayerParams &params);\n> +\tvoid setShaderVariableValues(eGLImage &eGLImageIn, const DebayerParams &params);\n>   \tint debayerGPU(FrameBuffer *input, FrameBuffer *output, const DebayerParams &params, std::optional<MappedFrameBuffer> *mappedInputBuffer, std::optional<DmaSyncer> *inputBufferDmaSyncer);\n>   \n>   \t/* Shader program identifiers */\n\nLGTM.\n\nReviewed-by: Robert Mader <robert.mader@collabora.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 43E9DC3306\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 24 Jun 2026 12:17:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 90B65658B0;\n\tWed, 24 Jun 2026 14:17:58 +0200 (CEST)","from sender4-op-o12.zoho.com (sender4-op-o12.zoho.com\n\t[136.143.188.12])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4123065718\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Jun 2026 14:17:56 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1782303469192818.7879882467067;\n\tWed, 24 Jun 2026 05:17:49 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"Cqi71yxZ\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1782303472; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=DI5cAvxxDvYl2gImR956Uv8sWv3bU7vx/2cCWLeDbsz2rvDZSl25hfz5ygvueaCGcYCbbBSLsLUd6q7Kx9/UVfhEkgQjwa0uW5pT58DUQV/g3MkC7rEnP14L319UyvB7NpV+fHsMMMnI+wiuFSVQAYkJM3YIf1NMVuH2myYePn0=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1782303472;\n\th=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=w63ZPO/MTmpeduiA52fA4rYjOvZ9lzaZwS13UXBdCk0=; \n\tb=Hm8VApw31Qpzf84FP0tSNn5hbCxKaFNJaPKy7YPrBC2LTSxoHqRhrNlKJP9lvT2rFn8aKuzrQFZXGJODJHt/3Hmk6s6Fj+/RCcs4cAdDHuXaIQeArIJ6NSRUtInVdCuZUPEgji+jVAQHynxHs98/pgVvBk8GMS4ihWoCeNQKVMs=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1782303472;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;\n\tbh=w63ZPO/MTmpeduiA52fA4rYjOvZ9lzaZwS13UXBdCk0=;\n\tb=Cqi71yxZa3dz28F2uXG+WWWG9EWRwtGlQvOIhAEHSHiJ4BQQPf1R+DpSfFp9tpRu\n\trZQCjcT1GoVk+nYcQtdwDCR3oUWgfYhVMgG8+O+0qaXI9PS+3UIcydLtIf3CvG+MuA3\n\t6mAbokY0iElaYGT4x53J2553gjd/Aqn8xF4UIqjY=","Message-ID":"<50930950-548e-4df0-93ee-e71afb46f1ca@collabora.com>","Date":"Wed, 24 Jun 2026 14:17:46 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 08/10] libcamera: software_isp: debayer_egl: Pass\n\teglImage as parameter to setShaderVariables","To":"libcamera-devel@lists.libcamera.org","References":"<20260624085849.873784-1-bryan.odonoghue@linaro.org>\n\t<20260624085849.873784-9-bryan.odonoghue@linaro.org>","Content-Language":"en-US, de-DE, en-GB","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<20260624085849.873784-9-bryan.odonoghue@linaro.org>","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":39450,"web_url":"https://patchwork.libcamera.org/comment/39450/","msgid":"<85a4shleyt.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-06-26T11:26:50","subject":"Re: [PATCH 08/10] libcamera: software_isp: debayer_egl: Pass\n\teglImage as parameter to setShaderVariables","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n\n> We will create a cache of textures and eGLImages which means the value\n> assigned to the shader texture unit will come from one of those now cached\n> eGLImage objects.\n>\n> Pass eGLImage as a parameter to facilitate future differentiation.\n>\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n>  src/libcamera/software_isp/debayer_egl.cpp | 6 +++---\n>  src/libcamera/software_isp/debayer_egl.h   | 2 +-\n>  2 files changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\n> index cdceacf96..f6b7b11e1 100644\n> --- a/src/libcamera/software_isp/debayer_egl.cpp\n> +++ b/src/libcamera/software_isp/debayer_egl.cpp\n> @@ -397,7 +397,7 @@ uint32_t DebayerEGL::preferredInputStride(const PixelFormat &inputFormat, const\n>  \treturn info.stride(size.width, 0, 256);\n>  }\n>  \n> -void DebayerEGL::setShaderVariableValues(const DebayerParams &params)\n> +void DebayerEGL::setShaderVariableValues(eGLImage &eglImageIn, const DebayerParams &params)\n>  {\n>  \t/*\n>  \t * Raw Bayer 8-bit, and packed raw Bayer 10-bit/12-bit formats\n> @@ -453,7 +453,7 @@ void DebayerEGL::setShaderVariableValues(const DebayerParams &params)\n>  \t * To simultaneously sample multiple textures we need to use multiple\n>  \t * texture units\n>  \t */\n> -\tglUniform1i(textureUniformBayerDataIn_, eglImageBayerIn_->texture_unit_uniform_id_);\n> +\tglUniform1i(textureUniformBayerDataIn_, eglImageIn.texture_unit_uniform_id_);\n>  \n>  \t/*\n>  \t * These values are:\n> @@ -542,7 +542,7 @@ int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, const Debaye\n>  \t/* Generate the output render framebuffer as render to texture */\n>  \tegl_.createOutputDMABufTexture2D(*eglImageBayerOut_, output->planes()[0].fd.get());\n>  \n> -\tsetShaderVariableValues(params);\n> +\tsetShaderVariableValues(*eglImageBayerIn_, params);\n>  \tglViewport(0, 0, width_, height_);\n>  \tglClear(GL_COLOR_BUFFER_BIT);\n>  \tglDrawArrays(GL_TRIANGLE_FAN, 0, DEBAYER_OPENGL_COORDS);\n> diff --git a/src/libcamera/software_isp/debayer_egl.h b/src/libcamera/software_isp/debayer_egl.h\n> index 4c7c86472..348d7305b 100644\n> --- a/src/libcamera/software_isp/debayer_egl.h\n> +++ b/src/libcamera/software_isp/debayer_egl.h\n> @@ -65,7 +65,7 @@ private:\n>  \tstatic int getOutputConfig(PixelFormat outputFormat, DebayerOutputConfig &config);\n>  \tint initBayerShaders(PixelFormat inputFormat, PixelFormat outputFormat);\n>  \tint getShaderVariableLocations();\n> -\tvoid setShaderVariableValues(const DebayerParams &params);\n> +\tvoid setShaderVariableValues(eGLImage &eGLImageIn, const DebayerParams &params);\n>  \tint debayerGPU(FrameBuffer *input, FrameBuffer *output, const DebayerParams &params, std::optional<MappedFrameBuffer> *mappedInputBuffer, std::optional<DmaSyncer> *inputBufferDmaSyncer);\n>  \n>  \t/* Shader program identifiers */","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 2C938BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Jun 2026 11:26:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 27730658F4;\n\tFri, 26 Jun 2026 13:26:57 +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 CCD7B65878\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Jun 2026 13:26:55 +0200 (CEST)","from mail-wr1-f72.google.com (mail-wr1-f72.google.com\n\t[209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-220-_IV-4He6OXCxnf7skDJLPQ-1; Fri, 26 Jun 2026 07:26:53 -0400","by mail-wr1-f72.google.com with SMTP id\n\tffacd0b85a97d-4621b17733cso378943f8f.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Jun 2026 04:26:53 -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-46c2279b7d7sm22548495f8f.31.2026.06.26.04.26.51\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 26 Jun 2026 04:26:51 -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=\"hEUjMw6C\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1782473214;\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=T5rjG8ncD7/lCOGol4kIUj4h1axLUg7dP22Brwao0Bo=;\n\tb=hEUjMw6CAoVnZV66SoTBHVmZ1uNc/NFHCkt+Q6eSoBX24jzT36AXFab86G9JFoSaADf15B\n\twIp8N4D7pQ/Wf+Ow6uPRbiwqICNIUgvHuhwGYT06u5d+1FfaYQo7mEXaqLx73Bk7ZsKpL2\n\tVOF+eqL4osMwiRxXhtlJw6C9Ie9s17E=","X-MC-Unique":"_IV-4He6OXCxnf7skDJLPQ-1","X-Mimecast-MFC-AGG-ID":"_IV-4He6OXCxnf7skDJLPQ_1782473212","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1782473212; x=1783078012;\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=T5rjG8ncD7/lCOGol4kIUj4h1axLUg7dP22Brwao0Bo=;\n\tb=Fgx3iT12l/4kzaHVvCv8ORLhvufD/NwarPPo1thiXDwPpTXrpGvG1Fy2izYNmnXYS2\n\tOOLvTadec1ujt4AgQO2pbpPoodzeET1I55IeJXB+ZHpkjDor3Z4DVNGIaMzSBxHkoirc\n\tbRvHjOSH0p3QeUim7bU5KgOV+9c1vQSccC260JUULwP3qcHNSdHj065YpeXgZ2bAcD8U\n\tLP0/i8A4wEt3TqXTeiz4stkVGhnHPDlh2asjzY5McnJRhgsvrIJJdq4YajVc51/a4Mvo\n\tNm3h2uxNEH/ugf/tadSMEHQRy0TRtMrz1+MT4/Z1XhV4KylTZqEOVuMm8ZhDHEKw7x4X\n\tAY5w==","X-Gm-Message-State":"AOJu0YzdF16Emz4EkgRxDPJf2CNNIO0XUZdZTLJ9Je/tWofhIr34OLgm\n\tVkBiERe8FqmNMzE80VpyMf9pC1LKcFOpE3W3Glwj3lmsRxnxHw40Q4iEZB32zVzxbIUzwoCv+Mb\n\tkzaIYxDDARkGzBip20EFY5y7l+ryU/Y3sArqZbHXp0ZcVuWEamJfma5DgyFdb6WPQw99+SRGNvD\n\tE=","X-Gm-Gg":"AfdE7ckCOS7n+oOzrhGL2albxTAFdutKqHBcbUJ00zKzzrr+muHRKnrFCMTiyFV4aBb\n\tJ4JI82Rkmdnvh2dJnbsWFcSJZ5ZY6BIBPYkj6kVLQ53vCrvvBByH/eC6HRvW/yYmAGiRinwaHV2\n\tDwdYqLca6/+QALljIyPmVfVsT+KdA/3MGijbrpYuF7VyNKQOCV4MknUyf/tIBdHhV8AeC1DP7NJ\n\tnUWQOnF+EogIKB8XyFU8O/lLAED1xx0t1APCOIjJl63JunQBqz0QQEl51xYx0d45ZPfBOtmk3uW\n\tJMszzddUCx6R/CgVYjV1fazz1ToUVaHcm0F/NmAB6z6RzIn9BPKV39Ghl+gFbKcohc9wgz35vOa\n\te2BGZZEgfBrnh7Jhs+GZg52i4ipvimziJxydzgjI8zKXl26Bm4s5MMmHUqppPCGA2","X-Received":["by 2002:a05:6000:618:b0:46d:e587:7701 with SMTP id\n\tffacd0b85a97d-46de5877838mr9537937f8f.43.1782473212428; \n\tFri, 26 Jun 2026 04:26:52 -0700 (PDT)","by 2002:a05:6000:618:b0:46d:e587:7701 with SMTP id\n\tffacd0b85a97d-46de5877838mr9537893f8f.43.1782473212066; \n\tFri, 26 Jun 2026 04:26:52 -0700 (PDT)"],"From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org,  pavel@ucw.cz","Subject":"Re: [PATCH 08/10] libcamera: software_isp: debayer_egl: Pass\n\teglImage as parameter to setShaderVariables","In-Reply-To":"<20260624085849.873784-9-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Wed, 24 Jun 2026 09:58:47 +0100\")","References":"<20260624085849.873784-1-bryan.odonoghue@linaro.org>\n\t<20260624085849.873784-9-bryan.odonoghue@linaro.org>","Date":"Fri, 26 Jun 2026 13:26:50 +0200","Message-ID":"<85a4shleyt.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":"tGwouRmCsoxJZr-8790Y9l5HBZQ0hduNJFkZ6Dfd3rA_1782473212","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>"}}]