From patchwork Mon Jul 6 22:22:42 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: 27256 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 53051C3308 for ; Mon, 6 Jul 2026 22:23:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 180186605B; Tue, 7 Jul 2026 00:23:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="OHuVteHy"; dkim-atps=neutral Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 577C16605C for ; Tue, 7 Jul 2026 00:23:00 +0200 (CEST) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-476d8e647e9so2903213f8f.0 for ; Mon, 06 Jul 2026 15:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783376580; x=1783981380; 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=OHuVteHydBBS5ekNpCdhJumVVcRnckUvAUM9Ny0m1mxGn3SjCmOXNexJ+CUlH4GMrD 6iB9WyYnsznAwAqcJwGSFh6fh6mSYGEGyVDTngwBzqY3WniBq0NyQ7naH/9/RW4fVCum /07GQtGOrkPaH/3mYDiqQPow92hZ7EBj+R4GPMlpdHNPsg42I5SUpJPvIGvgpC4wMeyt L2N89JgtexvA7XOWjvwLX3w8dL/TXIZD3uP+pvqEOQj3zocQU5KcFpjmMQQcbZa8wcSY /KnvD5LA4kqIdzISLF3suo+XC1t/KBjvFHFZWJGvO0eJMchH6gxl9hsbgpSjWsls/Uq2 s5lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783376580; x=1783981380; 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=FCtdzvyMuOSA+3ZmLIWJFUYrFKQ6XO+PpLJnYk30mqu8t3P4/UnYdR2BWfqk/vUlIw obH0STBv0mEq6pKghmld19k5SwCuHQkhyCTg4PLv0cu6Kfxf/wZiFVTjSXNR5PROqgXF fnXl0r2UWkT2jnMz9JyRLILooC3Q/szi0EAxhmAOL779/SaUP7wkSUrKj1RBErmYvuki a3rJ7bOfcFO/tli9ZgEs9tiskTl1UBkoQzNuxcJKHd3hH2azD+9HVF0uajWXdTWEYCpw gTOImI17auTtmeRAgRZ3qMoURsDkzHCa0GXzQvnsNboY2CE54qnswGnRvfzXuKngwtjm 20vQ== X-Gm-Message-State: AOJu0YwQlGRcK1Fc3srvPuk3a6t6jWiFD8A/5cPMvLiRx3r8Z7RFYxW5 +Y3ZOF6+jcELtuRoki0TUp3+PlDKJEIYQUMRUYQl57ljfMYlCfBTxN3f+NcZkD0mCUp2itjddbe LdFfx X-Gm-Gg: AfdE7clu9WwC9jD+Q12pVuaiLrGLGlaBcoRXSw50SUaWlx1cte8ndpO9SjI94l2zfMK /qxEghXuIL/9WTj1FYbNmjQQEe0al2AeHkshd3Mst/MI43Ki5fofI4sAntDUMaqlRmdkP0YyIoE Nlr31fdpVZtmT+7+VMG2OjTfIRhevcDDgJNyy0Jd+ZHC/gjbQIPt4DVJv2t8ehps97i2qZTOeXk VPksRxRXzuoGOOUvicLX+5q7FnY7t+B+4N5p8o7Dp+r2Xn61UDxqvB7snH9rW7tTRNgKAoF1hql rpLce3YxbT2QMa+YMGSDEHKzka3st+zRaj8ft+6jDwpfCZ6/8WfZilelnkPzR3qUkDpg0QPl5EJ hxoZwKlF9N5VP9I6I2f30K4hwJAyf3TODlbNLzAph99Ec03rT3JgawEeY+XChGtOgAcpC2v+r78 gOdn+ZSIP0mjP1S+1I+9Z+eq7xuFZT X-Received: by 2002:a05:6000:604:b0:473:506a:e47c with SMTP id ffacd0b85a97d-47de661f7e1mr2308962f8f.26.1783376579791; Mon, 06 Jul 2026 15:22:59 -0700 (PDT) Received: from inspiron14p-linux ([109.77.44.220]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa039ad21sm27916413f8f.20.2026.07.06.15.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 15:22:58 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz, Milan Zamazal Subject: [PATCH v6 3/6] libcamera: egl: Add createOutputTexture2D Date: Mon, 6 Jul 2026 23:22:42 +0100 Message-ID: <20260706222245.247396-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260706222245.247396-1-bryan.odonoghue@linaro.org> References: <20260706222245.247396-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 *