[{"id":38952,"web_url":"https://patchwork.libcamera.org/comment/38952/","msgid":"<6d4f2915-2da3-4f8a-8b26-b1a2e26069a7@nxsw.ie>","date":"2026-05-26T17:32:20","subject":"Re: [PATCH v4 2/5] egl: Remove some parameters from\n\tcreateTexture2D()","submitter":{"id":226,"url":"https://patchwork.libcamera.org/api/people/226/","name":"Bryan O'Donoghue","email":"bod.linux@nxsw.ie"},"content":"On 21/05/2026 16:59, Robert Mader wrote:\n> And use the values set in the constructor instead, bringing the\n> function in line with createInputDMABufTexture2D() and\n> createOutputDMABufTexture2D().\n> \n> Adopt the value passed into the constructor accordingly, which\n> previously was never used.\n> \n> Signed-off-by: Robert Mader <robert.mader@collabora.com>\n> ---\n>   include/libcamera/internal/egl.h           | 2 +-\n>   src/libcamera/egl.cpp                      | 7 ++-----\n>   src/libcamera/software_isp/debayer_egl.cpp | 4 ++--\n>   3 files changed, 5 insertions(+), 8 deletions(-)\n> \n> diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h\n> index 825240dbb..bcf09b475 100644\n> --- a/include/libcamera/internal/egl.h\n> +++ b/include/libcamera/internal/egl.h\n> @@ -105,7 +105,7 @@ public:\n> \n>   \tint createInputDMABufTexture2D(eGLImage &eglImage, int fd);\n>   \tint createOutputDMABufTexture2D(eGLImage &eglImage, int fd);\n> -\tvoid createTexture2D(eGLImage &eglImage, GLint format, uint32_t width, uint32_t height, void *data);\n> +\tvoid createTexture2D(eGLImage &eglImage, void *data);\n> \n>   \tvoid pushEnv(std::vector<std::string> &shaderEnv, const char *str);\n>   \tvoid makeCurrent();\n> diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp\n> index 2aabfc2e0..267d22c8b 100644\n> --- a/src/libcamera/egl.cpp\n> +++ b/src/libcamera/egl.cpp\n> @@ -240,9 +240,6 @@ int eGL::createOutputDMABufTexture2D(eGLImage &eglImage, int fd)\n>   /**\n>    * \\brief Create a 2D texture from a memory buffer\n>    * \\param[in,out] eglImage EGL image to associate with the texture\n> - * \\param[in] format OpenGL internal format (e.g., GL_RGB, GL_RGBA)\n> - * \\param[in] width Texture width in pixels\n> - * \\param[in] height Texture height in pixels\n>    * \\param[in] data Pointer to pixel data, or nullptr for uninitialised texture\n>    *\n>    * Creates a 2D texture from a CPU-accessible memory buffer. The texture\n> @@ -250,7 +247,7 @@ int eGL::createOutputDMABufTexture2D(eGLImage &eglImage, int fd)\n>    * is useful for uploading static data like lookup tables or uniform color\n>    * matrices to the GPU.\n>    */\n> -void eGL::createTexture2D(eGLImage &eglImage, GLint format, uint32_t width, uint32_t height, void *data)\n> +void eGL::createTexture2D(eGLImage &eglImage, void *data)\n>   {\n>   \tASSERT(tid_ == Thread::currentId());\n> \n> @@ -258,7 +255,7 @@ void eGL::createTexture2D(eGLImage &eglImage, GLint format, uint32_t width, uint\n>   \tglBindTexture(GL_TEXTURE_2D, eglImage.texture_);\n> \n>   \t// Generate texture, bind, associate image to texture, configure, unbind\n> -\tglTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, GL_UNSIGNED_BYTE, data);\n> +\tglTexImage2D(GL_TEXTURE_2D, 0, eglImage.format_, eglImage.width_, eglImage.height_, 0, eglImage.format_, GL_UNSIGNED_BYTE, data);\n> \n>   \t// Nearest filtering\n>   \tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);\n> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\n> index 8c1f2074d..696498a58 100644\n> --- a/src/libcamera/software_isp/debayer_egl.cpp\n> +++ b/src/libcamera/software_isp/debayer_egl.cpp\n> @@ -506,7 +506,7 @@ int DebayerEGL::debayerGPU(MappedFrameBuffer &in, int out_fd, const DebayerParam\n>   \tegl_.makeCurrent();\n> \n>   \t/* Create a standard texture input */\n> -\tegl_.createTexture2D(*eglImageBayerIn_, glFormat_, inputConfig_.stride / bytesPerPixel_, height_, in.planes()[0].data());\n> +\tegl_.createTexture2D(*eglImageBayerIn_, in.planes()[0].data());\n> \n>   \t/* Generate the output render framebuffer as render to texture */\n>   \tegl_.createOutputDMABufTexture2D(*eglImageBayerOut_, out_fd);\n> @@ -587,7 +587,7 @@ int DebayerEGL::start()\n>   \t\treturn -EINVAL;\n> \n>   \t/* Raw bayer input as texture */\n> -\teglImageBayerIn_ = std::make_unique<eGLImage>(glFormat_, width_, height_, inputConfig_.stride, GL_TEXTURE0, 0);\n> +\teglImageBayerIn_ = std::make_unique<eGLImage>(glFormat_, inputConfig_.stride / bytesPerPixel_, height_, inputConfig_.stride, GL_TEXTURE0, 0);\n> \n>   \t/* Texture we will render to */\n>   \teglImageBayerOut_ = std::make_unique<eGLImage>(GL_RGBA, outputSize_.width, outputSize_.height, outputConfig_.stride, GL_TEXTURE1, 1);\n> --\n> 2.54.0\n> \n\nI think the parameter should stay since for multipass we need to create \ntextures of different sizes.\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 CEA6DC328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 May 2026 17:32:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C0A7363024;\n\tTue, 26 May 2026 19:32:26 +0200 (CEST)","from mail-4318.protonmail.ch (mail-4318.protonmail.ch\n\t[185.70.43.18])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B400D62FB1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 May 2026 19:32:25 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=nxsw.ie header.i=@nxsw.ie header.b=\"XNc0YA0I\";\n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxsw.ie;\n\ts=protonmail; t=1779816744; x=1780075944;\n\tbh=44yUpj0pSJyYoPgAqTlE3S5mSg6a/p9CNhrQ9D1+qgE=;\n\th=Date:To:From:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector;\n\tb=XNc0YA0I3oMAVk590TyTHEXxpOa0+g1NaAIae1oNXiUJucHlzcaEBMOgbpX+g+vF9\n\tSSd1uWQuLtvghfkFTyA4+/RKlWrapY8du8jqobMed9pehpWv8tMVj1HrnTYxN98IkO\n\t6fkwr4J92WInUySZetkwhPpziZiYW0I9Xy8dJVvhmAO8lsDHi7U1nmzZiSMCj+OixH\n\tffxcMXCYDQUSBI7bVYR1VevSc/dfDYJA6ZB3zBFxPeHrvAalFB0RwX7cjtHwHoHxC0\n\tGpwf3DYOzU7lqQTGdPIf93o2p7HFXoz7Wgbdbfr97CBktJnnBG10Hage7ElZY95tP6\n\tneG6oIwpFWpNA==","Date":"Tue, 26 May 2026 17:32:20 +0000","To":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","From":"Bryan O'Donoghue <bod.linux@nxsw.ie>","Subject":"Re: [PATCH v4 2/5] egl: Remove some parameters from\n\tcreateTexture2D()","Message-ID":"<6d4f2915-2da3-4f8a-8b26-b1a2e26069a7@nxsw.ie>","In-Reply-To":"<20260521155906.120373-3-robert.mader@collabora.com>","References":"<20260521155906.120373-1-robert.mader@collabora.com>\n\t<20260521155906.120373-3-robert.mader@collabora.com>","Feedback-ID":"136405006:user:proton","X-Pm-Message-ID":"74ad29b0ac1d1908f98f8944cf3c6b6c7c732573","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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":38958,"web_url":"https://patchwork.libcamera.org/comment/38958/","msgid":"<0ff7515a-18fc-4d8f-93db-945d42a014ec@collabora.com>","date":"2026-05-27T08:20:32","subject":"Re: [PATCH v4 2/5] egl: Remove some parameters from\n\tcreateTexture2D()","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"On 26.05.26 19:32, Bryan O'Donoghue wrote:\n> I think the parameter should stay since for multipass we need to create\n> textures of different sizes.\nAs discussed offline this should work with the upcoming multi-pass work \nas well and we can thus move forward with the patch as is - therefor no \nchanges to the patch in v5.","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 763A7BDCBC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 May 2026 08:20:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6177B63029;\n\tWed, 27 May 2026 10:20:43 +0200 (CEST)","from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com\n\t[136.143.188.112])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 81C6062FEA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 May 2026 10:20:40 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1779870035527696.9133951627783;\n\tWed, 27 May 2026 01:20:35 -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=\"KI2LtMbs\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1779870037; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=EptAboutnV7AqJs5TceM1Ddcmy8WWANn9Zot92l2wwhDRWLDgh953B1hNJ62LEACqUecbIQV4JqZYlzfnIBArBLxdLRfrvwLqdwIlc1LeeHw3CX+IbepnfSK+WlCwSI0XY4ihqcVfb8Yjs6NOT26SrTi6x30kkX7Vc6o4cK/mhQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1779870037;\n\th=Content-Type:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=psp2MzSmUIwcstfbj1+GkUpu+qMSOWrFJL1wEwBrk1Y=; \n\tb=RfUh8T2nyQ4ymFyhsujKbbZ5jWZzcMpBrJXt3Q+daBhnXtSmKBYMj8GkO0F3hnCxVptWvpSTSGQQlo0/K9wcTimLuXuNoCsplt7dFYNPrdbDi1hHS8NxqIlIblrg8jT9aa1+dQ+SchLdSougt5OISTZlfNEscVxJb023u+w5p8w=","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=1779870037;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Content-Type:Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Message-Id:Reply-To:Cc;\n\tbh=psp2MzSmUIwcstfbj1+GkUpu+qMSOWrFJL1wEwBrk1Y=;\n\tb=KI2LtMbsnUgQJYuME9sPMAl0vQ1KLKa+OadWoid+VqKTzGakHUy7sWl2bTy/BzwS\n\tK+CopgQXmqCR5BRpF4dLApXafukTZV8XxnifEvDrJQLrMy4kTfIpsg2K4OGU/E3pVWX\n\tu5tgoOU76URQ7F1uclliSkHOE681rlaZgORPSD3Q=","Content-Type":"multipart/alternative;\n\tboundary=\"------------PvPul3icTXP9lXnur3oQaj8S\"","Message-ID":"<0ff7515a-18fc-4d8f-93db-945d42a014ec@collabora.com>","Date":"Wed, 27 May 2026 10:20:32 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 2/5] egl: Remove some parameters from\n\tcreateTexture2D()","To":"Bryan O'Donoghue <bod.linux@nxsw.ie>, libcamera-devel@lists.libcamera.org","References":"<20260521155906.120373-1-robert.mader@collabora.com>\n\t<20260521155906.120373-3-robert.mader@collabora.com>\n\t<6d4f2915-2da3-4f8a-8b26-b1a2e26069a7@nxsw.ie>","Content-Language":"en-US, de-DE, en-GB","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<6d4f2915-2da3-4f8a-8b26-b1a2e26069a7@nxsw.ie>","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>"}}]