From patchwork Thu Jun 18 12:22:34 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: 26954 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 55BE2C3323 for ; Thu, 18 Jun 2026 12:23:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5FBAE656CA; Thu, 18 Jun 2026 14:23:33 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="MqNLYLxJ"; dkim-atps=neutral Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5FFB5629B6 for ; Thu, 18 Jun 2026 14:23:14 +0200 (CEST) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-4631679f204so858905f8f.0 for ; Thu, 18 Jun 2026 05:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1781785394; x=1782390194; 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=vlemr6TP2yYXWCy4cCKcKNb9td/Kb7P/MkBIEIloaww=; b=MqNLYLxJz6cw53XHwr5qeCG7Oesh2UGnpyEsx+Aro1PXwA2Mk15UTsrtr4PA+jsaOh oYgbaGYAKoA3WltDHVdFP2dhXeCgeMvlfk/GfqMVQlSQ8IBcW4uPUvqqLrtuf6BUOAod GlMUGpP/FFDo+n970ueROCBuRu0Ybc6yp0PORAJb3r1F6Ew4HNlnlVQfXytCmfZR567z 06xExKMOjzSLksGiy9sUmvnvZZRDni1RPITzW66d8yiZQMn963OA27o+zGDoY66ce3xk lEdBiUUaAJk/tyAq4RVPZ6PEFtxrhugK+YczOcJKdq4PPfCKDmJtdr87TRid37QkYC3e gQpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781785394; x=1782390194; 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=vlemr6TP2yYXWCy4cCKcKNb9td/Kb7P/MkBIEIloaww=; b=nF3Eu/hGkiEkDGu/w+nnArY8ZoECi3NTRY/jfxNdszUZ3y6/joFQfPPhvTZSx2sBvb 5Qrx+sfo7VQclrRjysIvzby0F4M6IB8RIWFqsRuY6b9pwEVJWPM/PwNS/DeRCvhl2F6l XVwYatKm1kpEaQ1EeW494OSHPA+mrDsq/0gvBRVxZces4XhQOPiqNbJkBYJ7uF4ntOh6 5mr5f0EmqYNWXGYDPrDHIKzOIS7zfXik2tkIKBN/KNDnVFxRx7OVg6xFmGsY8FURHJep l+ZTR/4m9ev/xQ2ycW9Kq/he+55tuIR8LkAhrygMV0NLpHXu36BfS02q+qwAMQOQ+Zlu KnNA== X-Gm-Message-State: AOJu0Ywt9CnF1i4SKxJbakr1CKkmWFnI5sbja/Ch2IbMHv/u62UOTwit oSlpc5wtWyOsikxrXBup32702MswD0qoQyi9HV+nJqUovl4tmJKwwk8/Sp1vrEjFFWqCn20sa8A q/r9svCg= X-Gm-Gg: AfdE7ck6Tz75w+s2hlBLZFsSrD+CVQe2csBXwnjGieSuts2orGGuF9UHL2npzjpGiAR de2+sMq6Fn/waMZhPjjp7HR145E2oV+BqnAWju7hExfwWmJfvNFR2dcPmO37LGwDKcRwKD955Hv cqeev8iczugTW9/NeMu4LDvcJD1MVW1UVrTNpPpednGVFvU2RMnBv4Dj9XwZT73tlylG6N141y0 U9M+kYh+DNNlKXN+q362R3P1Qm9POUY/Bsb8zb7McRq5lR6aBB/dl/j73ZzxnPnf51DfFQCWvry gtbPO+V+VDerzUOgHCcglgXX1iTXsZ+tMxEpj8hR6BN46qZ4iGluXcFEAcsReiXa9s/VJT2Xid5 ++mFJM8GQGMl6vBkJnwuzYRzu5kW4B9ciCQKX9m3PP0sD7Wwl9VfTPe13SN+pl25h35QSet6wwg lQsVTkaz3+segXsMkovDL7/F92fELP X-Received: by 2002:a05:600c:6089:b0:490:5000:917 with SMTP id 5b1f17b1804b1-4923815425fmr47375175e9.1.1781785393854; Thu, 18 Jun 2026 05:23:13 -0700 (PDT) Received: from inspiron14p-linux ([109.76.144.236]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4922fa3a4easm275198015e9.3.2026.06.18.05.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2026 05:23:13 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz Subject: [PATCH 21/30] libcamera: software_isp: egl: Add createOutputTexture2D Date: Thu, 18 Jun 2026 13:22:34 +0100 Message-ID: <20260618122245.946138-22-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260618122245.946138-1-bryan.odonoghue@linaro.org> References: <20260618122245.946138-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" Signed-off-by: Bryan O'Donoghue --- include/libcamera/internal/egl.h | 1 + src/libcamera/egl.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h index 182a4dc55..d3749d2e7 100644 --- a/include/libcamera/internal/egl.h +++ b/include/libcamera/internal/egl.h @@ -107,6 +107,7 @@ public: int createInputDMABufTexture2D(eGLImage &eglImage, int fd); int createOutputDMABufTexture2D(eGLImage &eglImage, int fd); void createInputTexture2D(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 ffaa6bc49..8d135e092 100644 --- a/src/libcamera/egl.cpp +++ b/src/libcamera/egl.cpp @@ -297,6 +297,22 @@ void eGL::createInputTexture2D(eGLImage &eglImage, void *data) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } +/** + * \brief Create a 2D texture attached to an FBO for render-to-texture + * \param[in,out] eglImage EGL image to associate with the texture + * \param[in] format OpenGL internal format (e.g., GL_RGB, GL_RGBA) + * + * Creates a 2D texture in VRAM. The texture + * is configured with nearest filtering and clamp-to-edge wrapping. This + * is useful for uploading static data like lookup tables or uniform color + * matrices to the GPU. + */ +void eGL::createOutputTexture2D(eGLImage &eglImage) +{ + createInputTexture2D(eglImage, NULL); + attachTextureToFBO(eglImage); +} + /** * \brief Initialise the EGL context *