From patchwork Mon Jul 6 11:01:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 27240 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A7FBCC330F for ; Mon, 6 Jul 2026 11:01:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5DF476600A; Mon, 6 Jul 2026 13:01:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="gPkkj/me"; dkim-atps=neutral Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AEB2966009 for ; Mon, 6 Jul 2026 13:01:33 +0200 (CEST) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-493bb510ce4so21686625e9.1 for ; Mon, 06 Jul 2026 04:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783335693; x=1783940493; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=39/wg15FASnXwYPaNXZRuMgZsbEtqLQEwRNrqEYsJnk=; b=gPkkj/mebEFhnO2hWCz1NWb8//93i73O7xH43v0yDIFYs5CJrhUFZFPNcHtt3dfKCu 56wfP2pj9unSjIbqVSmaGGRsv8EbNZwz+e3KAuwzMOAOOIZ4x8LrNeN+mmDQ/T6TZmdl FideonFLETVfAW007ZrkZpK7MOocFq6W/hLefclHbv5HGjmaDWPL7l+eAliop5QiYvWL JwkMGr5yNT5AgUn+DZu5B6MswA8mCJG21CVvmuSTAMkUkXZK4S2O88oRE3jWb5a/JbKw 0CTcOoUBi1nFi+08G4ndy3sN1YvPFNu5oeypnehSiESsqDF5Xdj2ia79G3z26/qZj3+g 9okA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783335693; x=1783940493; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=39/wg15FASnXwYPaNXZRuMgZsbEtqLQEwRNrqEYsJnk=; b=KnwEqj8IuF27Jsy3k/ahjjlliqaWgsS1Grh8aDZpaXYQrK3p9+D0eCbr5nqisNEuZ2 +2Z4mmJc/7aA296zlucC0tseB9uM3mR1ENpdmFqQ6d6kOyqnO5w+pRA3w3XODRw8mTAF H8Sh3CcJWw8fqoklZQH6jtDuSuDBntppkErQiE9JuR7GhYJN8pTX+Ea6qCqbqyPaqiDo iUpqRS+3c75bTNJQoRw008RITsIZHe2oOPGctjRhpKi4tjb3XZjLDMRi5E8CW6tWFtPN J+8jQZqTzK5o23TnCS4ALezZdXAwd06fB4/apTfPD/1mof96JJA18evb+Lz5+4Wjans/ VasA== X-Gm-Message-State: AOJu0YzlxYuN6mR10cPb8koyJI03BCdWay/LXmZ2fgXqBEFJ0V/QPXhn KermmVxW8WBDrlPnlgCF9/dlaGB8eLhRZf3hxz4fvP3KVtHEXqQW9ws4WVE4CgLcg9UmDinQFFK lqb9T X-Gm-Gg: AfdE7clLqp8c5KM+CWLJeveN1IlKDew1CBzRlpE/PB0bfDvl+mF9jGclfdznk7aj86Y aZO3aIG4F7CELPYdc7ZwU+4S8y2I+vX/w6AFdAs9z1gznfeEDyhSCHgqX30nWwDrm/3BlhtjRm7 krBcH59kVNN+zxa//rnhwakAoMZw3AR3zqfBlNiDJoBA9rIQdRN2LzF5KOPuaCUpj0R6Zvfrr4i bfDSu39w4skyz5gi1O/m90IMnDURY9H8HXhxiTASMIxN5dmXKBzdk2jRiYMBDGd8YJC0lKcNJOM d2hPNLiagOXVJO6GJ666rsXgWDnvTYJdEV9n+AgCnaOejNLQYqCHFXwrnErZnEFK6E01hQIL50O PJzj6Yp7DqBiJvl3C6ZplOTugLhbQ5AR84ip5Ck79nCI19Ya6RJiDho/pD3+UBvFPTHF4Xt68l8 YmnCAqzWLbknr8pVvBKFo7PrCcZppb X-Received: by 2002:a05:600c:528c:b0:493:c194:4e7a with SMTP id 5b1f17b1804b1-493d11d3d1dmr114044425e9.3.1783335693085; Mon, 06 Jul 2026 04:01:33 -0700 (PDT) Received: from inspiron14p-linux ([109.77.44.220]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa0960634sm25190846f8f.26.2026.07.06.04.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 04:01:32 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz, Milan Zamazal Subject: [PATCH v4 3/7] libcamera: egl: Add createOutputTexture2D Date: Mon, 6 Jul 2026 12:01:16 +0100 Message-ID: <20260706110120.2509826-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260706110120.2509826-1-bryan.odonoghue@linaro.org> References: <20260706110120.2509826-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Creates a non-dmabuf texture attached to a frame-buffer-object FBO, which allows for render-to-texture. Reviewed-by: Milan Zamazal Signed-off-by: Bryan O'Donoghue --- include/libcamera/internal/egl.h | 1 + src/libcamera/egl.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h index 085a371f3..1955d09c5 100644 --- a/include/libcamera/internal/egl.h +++ b/include/libcamera/internal/egl.h @@ -108,6 +108,7 @@ public: int createInputDMABufTexture2D(eGLImage &eglImage, int fd); int createOutputDMABufTexture2D(eGLImage &eglImage, int fd); void createTexture2D(eGLImage &eglImage, void *data); + void createOutputTexture2D(eGLImage &eglImage); int attachTextureToFBO(eGLImage &eglImage); diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp index ed67aca7b..c1b5514b6 100644 --- a/src/libcamera/egl.cpp +++ b/src/libcamera/egl.cpp @@ -329,6 +329,19 @@ bool eGL::isAvailable() return true; } +/** + * \brief Create a 2D texture attached to an FBO for render-to-texture + * \param[in,out] eglImage EGL image to associate with the texture + * + * Creates a 2D texture in VRAM. Subsequetly attach the texture to the + * texture unit specified in the eGLImage object. + */ +void eGL::createOutputTexture2D(eGLImage &eglImage) +{ + createTexture2D(eglImage, NULL); + attachTextureToFBO(eglImage); +} + /** * \brief Initialise the EGL context *