From patchwork Mon Jul 6 11:38:56 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: 27248 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 BBC7BC330A for ; Mon, 6 Jul 2026 11:39:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 49C4D6604D; Mon, 6 Jul 2026 13:39:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="d7EZIqQq"; dkim-atps=neutral Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F05866601C for ; Mon, 6 Jul 2026 13:39:13 +0200 (CEST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-47d6c634f45so968045f8f.3 for ; Mon, 06 Jul 2026 04:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783337953; x=1783942753; 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=d7EZIqQqOoKTvNxQFXsowZcCnhvVcy1pW9TMPv7kf5OC5pycHTkl36MeVGiCrUjhYr igJV1dRennq+x+PzT0hEmaZLnykcHyFWziJuc4q7Qltn3GjL+H3IXxUsSlmYVee4iBmp u1xIH6qxF1X4zIs6rkEjYAIG3IUteSLO9Ck7XXFnIrDp16ezJIgX5rZXapscU/TEHMDf YyuarIv69S5txv63BIjwFVw5Ue5Mz9VMwO2bmMndWiWInu5k9tBnt6NlKDacJLqOwa75 aHhfgAX2GOsW7xt4dKYiOvxzvxlo754H0CIQIPzBT1oOBFwe1lWMadBB0NwBQFKL3+EM Vx6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783337953; x=1783942753; 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=A1Jt+hKcY6YWW1WO2o5+9IM0DyHsFd8gJVjY1aehComCwaRlMoUA8yga+CZ2wvxq/P G8x9YI/q9GcfinTCVU89/Hkm+26f0eoP0Imapzri3XYkyPa24jDEtyAnbutpMhTiDZiy Q82wKJp7YaNvv+k7kCwdzYKBtYQljHkCG8zyVT+joOE2xDidjj9aMm1o+TKS5dDCGK9s qBrQ8YvNFizPZurwkghSPx7x8Y4eVuOCUwp6M2TjBMh6mLvUOyj7YHpFus1BqA5QZ80l MtWH6DPF7K/2BB45XhtIR9dL5mQ9whyPbent9Xtfgz+bk2O4gz+4vGrXbXRsuxa9kgAd 9CpA== X-Gm-Message-State: AOJu0YxSUtt2zB2Ait4K/CofDOtAgKjDDlPnK8q0FQ/9DmpuQxsX9dhe 7AG/uQHcV2BWiQQcpgRMtp7fqJI3HwzV7cziszsWPkwFMS0aQ1jG/u/gJZv9Ed7daKy/nkGckaN /+oNt X-Gm-Gg: AfdE7clWcJefh6vBZa7hyct0K/EqqN9/XjEmraohGwRtfGqlwjUAffZDSPIJWDXE8w+ U9BFk0P/MiDdJciY9VJGnNJ0AlScU0vMXOMC9cHS3fN7nnTa3QDRcvoS3uUeqRBlGQhQGsk7PYZ X/xeQoJkD1xM0A2rP7/EADv6RUS7SknhmPeV8w3oZxHbsCZ0Do4aXkcrrb7hSMk/GY+8e8EEE/J 9GSZ2uUtKITyQwA0kGJgAu7Qg5VWL7mEM8ag2SVhW1rdAA62rnbgWkOIoTwuFeB1CzWYm2JTOvR X9o9dp9xswb3fnNWFV/MUyZUbGUME1xZlnLlPx27SJKZLzuca7LIUFO8B87ZZqGfmDjjEzn5mt9 KScG/KAoQe+zDCgnQuY7xCf4jpjzzXkKLEWHR9UzVKsvAbwl61HbjSXjtSBmIZrvx7OtZXDXSzv J78/zFK0YIKNiRoRwggD5YC0NxQpqm X-Received: by 2002:adf:f00f:0:b0:475:f0c2:5b04 with SMTP id ffacd0b85a97d-47aad54d643mr8112013f8f.58.1783337953466; Mon, 06 Jul 2026 04:39:13 -0700 (PDT) Received: from inspiron14p-linux ([109.77.44.220]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47a9de1e6ccsm24796084f8f.5.2026.07.06.04.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 04:39:13 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz, Milan Zamazal Subject: [PATCH v5 3/7] libcamera: egl: Add createOutputTexture2D Date: Mon, 6 Jul 2026 12:38:56 +0100 Message-ID: <20260706113900.2530549-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260706113900.2530549-1-bryan.odonoghue@linaro.org> References: <20260706113900.2530549-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 *