From patchwork Fri Jun 26 11:33:21 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: 27051 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 B0AE9C3264 for ; Fri, 26 Jun 2026 11:33:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 590D765EDD; Fri, 26 Jun 2026 13:33:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="gWy/lazx"; dkim-atps=neutral Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5EEE465902 for ; Fri, 26 Jun 2026 13:33:42 +0200 (CEST) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-461edb387ddso853909f8f.3 for ; Fri, 26 Jun 2026 04:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782473622; x=1783078422; 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=jUQq+g3RcjEZNYlYpd5HRjFjfEB5jMW9ZdOwMImzcgY=; b=gWy/lazxciK1ZKuzVcSvzsUcpdJ5vVycn01MVWlkDXcinSE1OJgxndX0/VU8EXPNNr 1JSff9EVQwmAoOX9u8NmjHzlWdkTqClSEr9hIZyjQ1XDouf/VYbF4BH7Cs/GdC+6KkhW ryxmbxXhKnfDfOQ1K8mF/zR8y7w3/c4Qisr83o9GFF5+zwF9H7tCk4j6HU4XH4h3jqjf EknxdOxUH+oiQqFXZ8baTVPgl7kkfD/nA6DiVsgheVLve3zlcUVVxvzPs7In46nmqsdj af818ufFDp2IZsLev6E985MUXxLJNCjf9D1H/ZLIDoc4ORYDTEtksEol/HApnd4zzTt/ 4f2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782473622; x=1783078422; 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=jUQq+g3RcjEZNYlYpd5HRjFjfEB5jMW9ZdOwMImzcgY=; b=W/Z5NBGBStgkoQCrVYc+4P7jH2kMlTMn7n0ENUcBEMmGU2z2qLGWcGQX6j6FKpyT8r VFeQqoErcQs2cvG7s1goWxCcB3vqQdYBowi/ivB7MOSsR8d2mez9CIUI72Z0kkhpHz6u Ds2OGXkbq2kFd4WkNCpV1Jgk8B3yP9Hz3EUAu9Fqe42bgoF4nREXCPkRd2Sit4yqiwZy 6jYaEetscZWtK5izd4tWNUBS776A1Tss0xWKuIVT40Zex8/7dVHu2/tZVh/y+t0P5kBw SZujN6itoVtXY659pZU4kLX6OE9X3TI41vaFxL8RwfGrc75x8l5pWX0qziTzslUjYRLV Q5XQ== X-Gm-Message-State: AOJu0Yz0niEqQ+WfEcoDTf1+bDfnP2eGJu1Rqh124GTrj4FOdtudM1Vv Zqz4MOc6x330MOg3pDhKh36iGEmaOw3f362XQVSssuoDbMhNv6ycCKU5N/Oo71rfTlQ0UFaUBIR FTS6e3Fo= X-Gm-Gg: AfdE7cltiGYSM6XhEZvJKpeVZ/+u+5uDVdrqhOPSd3mOFVULbqK2yGwOaSIsSUgZKIg mjbQ8UBm5eLQFgn4CDJclZW7RmhEbTazTkYtdUrMjbvZ5JcYNwhKbYWEknsQcOHdJPSB7xIHYma rkog2KtIwFKHdaEYJHpSxpT4yqdY98PBc8xF1l3jizgTZyd3eQAZ4dF4Go5hd5COl4M2Qs/9GT9 iNtDjyVYpIweJY2JmCDQCMY/KDGzJE606z1fCV1Dgvwk2OtpzP6KdzoHrdC0//0zShsW+vi+kCx tXbxD06zSYpbXAA5Qei7i+RW+fnpKn6mh3OG7q7hjVyFATlC7mRNxm/u53HEwOw+0ak4g8b9cJr 8/U76M/EQZUEhz0XRSR8Y6kNg4aIDXcirqy+Zj6DxyVCSSXGwvSP4fvp+j3dEjveI2XI3NnAHuJ JF0alyLge56lg2OX9OTgrYAPJMDQ== X-Received: by 2002:a05:600c:a49:b0:492:5bb6:6d4b with SMTP id 5b1f17b1804b1-4926689abd5mr89120615e9.34.1782473621893; Fri, 26 Jun 2026 04:33:41 -0700 (PDT) Received: from inspiron14p-linux ([109.76.78.98]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49268fe31b0sm79265985e9.4.2026.06.26.04.33.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 04:33:40 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz Subject: [PATCH v3 4/8] libcamera: egl: Add createOutputTexture2D Date: Fri, 26 Jun 2026 12:33:21 +0100 Message-ID: <20260626113325.3218045-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260626113325.3218045-1-bryan.odonoghue@linaro.org> References: <20260626113325.3218045-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. Signed-off-by: Bryan O'Donoghue Reviewed-by: Milan Zamazal --- 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 4b0757afd..e24a726dc 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 e83e24606..8e8d61813 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. Subsequet 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 *