[{"id":39383,"web_url":"https://patchwork.libcamera.org/comment/39383/","msgid":"<aa28d6d8-1c8d-4b76-a1d2-c64c9fd78037@collabora.com>","date":"2026-06-24T12:07:36","subject":"Re: [PATCH 05/10] libcamera: egl: Add createOutputTexture2D","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> Creates a non-dmabuf texture attached to a frame-buffer-object FBO, which\n> allows for render-to-texture.\n>\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>   include/libcamera/internal/egl.h |  1 +\n>   src/libcamera/egl.cpp            | 16 ++++++++++++++++\n>   2 files changed, 17 insertions(+)\n>\n> diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h\n> index 0709f9019..b992baf25 100644\n> --- a/include/libcamera/internal/egl.h\n> +++ b/include/libcamera/internal/egl.h\n> @@ -108,6 +108,7 @@ public:\n>   \tint createInputDMABufTexture2D(eGLImage &eglImage, int fd);\n>   \tint createOutputDMABufTexture2D(eGLImage &eglImage, int fd);\n>   \tvoid createInputTexture2D(eGLImage &eglImage, void *data);\n> +\tvoid createOutputTexture2D(eGLImage &eglImage);\n>   \n>   \tint attachTextureToFBO(eGLImage &eglImage);\n>   \n> diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp\n> index 2825d34d3..123653b58 100644\n> --- a/src/libcamera/egl.cpp\n> +++ b/src/libcamera/egl.cpp\n> @@ -345,6 +345,22 @@ bool eGL::isAvailable()\n>   \treturn true;\n>   }\n>   \n> +/**\n> + * \\brief Create a 2D texture attached to an FBO for render-to-texture\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> + *\n> + * Creates a 2D texture in VRAM. The texture\n> + * is configured with nearest filtering and clamp-to-edge wrapping. This\n> + * is useful for uploading static data like lookup tables or uniform color\n> + * matrices to the GPU.\n> + */\n> +void eGL::createOutputTexture2D(eGLImage &eglImage)\n> +{\n> +\tcreateInputTexture2D(eglImage, NULL);\nAs noted in my reply to the previous patch, I'd slightly prefer use a \nprivate createTexture2D() instead, which would be in line with \ncreateDMABufTexture2D(). I guess it's mainly that mismatch between \nDMABuf and non-DMABuf functions that I don't like.\n> +\tattachTextureToFBO(eglImage);\n> +}\n> +\n>   /**\n>    * \\brief Initialise the EGL context\n>    *","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 68317C3306\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 24 Jun 2026 12:07:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 20E4E6589C;\n\tWed, 24 Jun 2026 14:07:45 +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 8352D65718\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Jun 2026 14:07:43 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1782302858094105.0246554218246;\n\tWed, 24 Jun 2026 05:07:38 -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=\"kEpYN7NJ\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1782302860; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=GpsAPcm5/MCAkiRyV86ZY4nE5gk6MfdNkA8kBubUQe4fExvObHXkaDLx21MEFOO2+0erHOp+wGeWxKi1yEhkQWJJ8yZk81MgU3FRYni66DT+Ir1ShOEvnAhC6saZyk21SMydxchRAR3u6B7zlDfEqQe4x8FdjGu1xD5V27/cEyw=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1782302860;\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=JXJQSereFyXZK2vVX8AkAC2a0LUEmG576ciHahHsEa4=; \n\tb=RvxDq1M05hNpQGBJZ/DFApw2z+E3RfRF1dW9LPqRvQC4q0WvTUFns02l3Ae2jcRDNkhJUQB89+2/VetRS/ihcim9gL6yg5XfjOpaH7vSr/PEFsmOE2rBQcyTZi0sTk5QZFZUEhIj71FIdmIEq136DGdXfyIbMpT6loVwePbzel0=","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=1782302860;\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=JXJQSereFyXZK2vVX8AkAC2a0LUEmG576ciHahHsEa4=;\n\tb=kEpYN7NJZUi8vdd3Fb+tUSfSDJRQPBYeW53xcty1dkvwPgN0sD8A95lEv9YlKwFd\n\t++tZD6zewHV7gr+9wVeKM4+VYlvOgCydwPKkouEOQC81Cbv5dtX8VnCmHBtTxQG91XV\n\tWfhSYW1ICpWscc5mE8uVXuDSJw9UOmbVhZGkaI9I=","Message-ID":"<aa28d6d8-1c8d-4b76-a1d2-c64c9fd78037@collabora.com>","Date":"Wed, 24 Jun 2026 14:07:36 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 05/10] libcamera: egl: Add createOutputTexture2D","To":"libcamera-devel@lists.libcamera.org","References":"<20260624085849.873784-1-bryan.odonoghue@linaro.org>\n\t<20260624085849.873784-6-bryan.odonoghue@linaro.org>","Content-Language":"en-US, de-DE, en-GB","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<20260624085849.873784-6-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":39445,"web_url":"https://patchwork.libcamera.org/comment/39445/","msgid":"<85mrwhlg4x.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-06-26T11:01:34","subject":"Re: [PATCH 05/10] libcamera: egl: Add createOutputTexture2D","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Please address my comments from the original series.\n\nBryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n\n> Creates a non-dmabuf texture attached to a frame-buffer-object FBO, which\n> allows for render-to-texture.\n>\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>  include/libcamera/internal/egl.h |  1 +\n>  src/libcamera/egl.cpp            | 16 ++++++++++++++++\n>  2 files changed, 17 insertions(+)\n>\n> diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h\n> index 0709f9019..b992baf25 100644\n> --- a/include/libcamera/internal/egl.h\n> +++ b/include/libcamera/internal/egl.h\n> @@ -108,6 +108,7 @@ public:\n>  \tint createInputDMABufTexture2D(eGLImage &eglImage, int fd);\n>  \tint createOutputDMABufTexture2D(eGLImage &eglImage, int fd);\n>  \tvoid createInputTexture2D(eGLImage &eglImage, void *data);\n> +\tvoid createOutputTexture2D(eGLImage &eglImage);\n>  \n>  \tint attachTextureToFBO(eGLImage &eglImage);\n>  \n> diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp\n> index 2825d34d3..123653b58 100644\n> --- a/src/libcamera/egl.cpp\n> +++ b/src/libcamera/egl.cpp\n> @@ -345,6 +345,22 @@ bool eGL::isAvailable()\n>  \treturn true;\n>  }\n>  \n> +/**\n> + * \\brief Create a 2D texture attached to an FBO for render-to-texture\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> + *\n> + * Creates a 2D texture in VRAM. The texture\n> + * is configured with nearest filtering and clamp-to-edge wrapping. This\n> + * is useful for uploading static data like lookup tables or uniform color\n> + * matrices to the GPU.\n> + */\n> +void eGL::createOutputTexture2D(eGLImage &eglImage)\n> +{\n> +\tcreateInputTexture2D(eglImage, NULL);\n> +\tattachTextureToFBO(eglImage);\n> +}\n> +\n>  /**\n>   * \\brief Initialise the EGL context\n>   *","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 AA0ADBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Jun 2026 11:01:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 55160658F8;\n\tFri, 26 Jun 2026 13:01:42 +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 839DE65878\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Jun 2026 13:01:40 +0200 (CEST)","from mail-wm1-f70.google.com (mail-wm1-f70.google.com\n\t[209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-248-bCk_qyqAOsWd7bhG1q7PNg-1; Fri, 26 Jun 2026 07:01:38 -0400","by mail-wm1-f70.google.com with SMTP id\n\t5b1f17b1804b1-490b37e1f47so5525615e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Jun 2026 04:01:38 -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-46c221d93eesm23160505f8f.20.2026.06.26.04.01.35\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 26 Jun 2026 04:01:35 -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=\"aoGl5BSF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1782471699;\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=2yLISVn4f79K6skb4439lIiXFSiaGWM43QrfzW/S3nA=;\n\tb=aoGl5BSFYmaOLkubzEMl/UhTyzrtMXybeLPwvQyYNOrYSAQ7MEBV5YPPZnTKJCUc+GlhUi\n\tgZSjiwWy1klQXU5oR7jlOpveM6MRY4+To1pIwKFJ/TlrULoksMX0bad14fiTt2/FdQBzNP\n\txa//81yi0lzDLmjQhOJc4JnLfbSS+DM=","X-MC-Unique":"bCk_qyqAOsWd7bhG1q7PNg-1","X-Mimecast-MFC-AGG-ID":"bCk_qyqAOsWd7bhG1q7PNg_1782471697","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1782471697; x=1783076497;\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=2yLISVn4f79K6skb4439lIiXFSiaGWM43QrfzW/S3nA=;\n\tb=dDs944p+mD4Xn5BJZAmLB5ooCGk6qbdPg/r76U6fqdPA0Iw78sWgjS5T2y+R8xPeep\n\toiM8C8FyCKJG3iMQQXquc3hm0cXPEsSyJ0y5xMk9oSt0KPz4wLB1ZHCg8/pGYzLB8XUt\n\t7ROV1/HJTnlqgqxm5kC/so4kxiqR+CXFsciw7hTK2HaNnn4dAqsYUnRTbuN6PgaZa9PD\n\t5W/Y+I0OYYASkUWhLprmRgiEGXVjfa3vF66p0tE8CZ/4S3YHi1HLQfp/3xDwGObmak+D\n\tKDv6df8Ahc7esp4s01nByVRMS89iNbMPnmYRlETc8yK1w3Tb/x7MS2btIGGwlFooa80b\n\tzsjw==","X-Gm-Message-State":"AOJu0YyVctjfqQampta5tTOKH1342KL/L9L6WhPA78+0ibkQ0zgMbKz6\n\tvs+/Km1oWkW/PR8J903/2xJixBbBDCXnFfrfRSaeCyqa0zF1nBVwNULTfQg0eXKsEvwV8Gne3K2\n\t1jgorl/HMCBm8TkHHDOLG4fvuYtxLdvJLIp5eidFmhQqeQAci6HlklUaJgu3uS2Yh3jkafqtgD4\n\tQoGmSJCqo=","X-Gm-Gg":"AfdE7cmYoZoSqKwQ5iEMvTd+dBARNgDkyMeILpUvti/BZ31ja1Fk3hzSQl/bQkwZBhz\n\tI5qZCzZqe0BuqWLpJXDmNHJ33hs3OGq7jJnIykN2tDsNYzy0oxVZaBUY0mt1hSoz+Ffr4lOOxMd\n\t/NwhQt+urO2g7KKObLkDSo+MIrzOIvJP4wPs2ELWW4Bv0CGrhzsRxQm8Sb3C0oTYd5hCWXQ5S8f\n\twG8OX0qQUdFS5/f4B1I4E9t/iplvN7V1JENVq+WPc9f3A8Lh3ELiq3VJNvO/vAeIviGXzq8Z44g\n\teZYnQmrhQASvhY2EOhT+et9g5gGah8pTzCXwqesYn2e3/nVXM8Tm7vojpKuyukGEiP2CwpPkSqm\n\tm1y5N80iv1t8DgULuUTFOo/UtuDyoOeZXHKMdUuPgPHJXbYlhTFzwPFjFSjLC48qT","X-Received":["by 2002:a05:600c:4512:b0:492:53e2:7712 with SMTP id\n\t5b1f17b1804b1-492668856fdmr99334495e9.21.1782471696881; \n\tFri, 26 Jun 2026 04:01:36 -0700 (PDT)","by 2002:a05:600c:4512:b0:492:53e2:7712 with SMTP id\n\t5b1f17b1804b1-492668856fdmr99333895e9.21.1782471696394; \n\tFri, 26 Jun 2026 04:01:36 -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 05/10] libcamera: egl: Add createOutputTexture2D","In-Reply-To":"<20260624085849.873784-6-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Wed, 24 Jun 2026 09:58:44 +0100\")","References":"<20260624085849.873784-1-bryan.odonoghue@linaro.org>\n\t<20260624085849.873784-6-bryan.odonoghue@linaro.org>","Date":"Fri, 26 Jun 2026 13:01:34 +0200","Message-ID":"<85mrwhlg4x.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":"XbhZDCDz8nF_qu1lbxV6fqisI40DNWUZs4t3l3zTGiE_1782471697","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>"}}]