From patchwork Thu Jun 18 12:22:28 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: 26948 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 89704C330F for ; Thu, 18 Jun 2026 12:23:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DB047656C7; Thu, 18 Jun 2026 14:23:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ahpWDs48"; dkim-atps=neutral Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BE48562C7C for ; Thu, 18 Jun 2026 14:23:09 +0200 (CEST) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-490ae94a89eso6313405e9.1 for ; Thu, 18 Jun 2026 05:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1781785389; x=1782390189; 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=Q1uKl0CNvdgfWO0Mn4aUOTwFartpNuJZP4m4+2UlupY=; b=ahpWDs489/0GvtY4G99mdVZPs6nesEQFQi5LVRL8NuULOU7mXtoj1kNvm6n+aAeuZJ c0JqrHZ/G3gdISLDxn57t/J/XnBCKxSGghFhfYo3M/7+gbvxPh+1tv30Igp/IsKzOQGH DVhatu3KLhivAvyb5Baho8OmWkWwNA0o7F+MQhLJK7FRkKHDacG0Brn3bDoVEEgUNOWB fp5t4EDNrExSHR3w83H8MV6K+julCQmtuFLRGR424c4aEEgBDZqpO4QHUvtzmmOjaZp5 GjQDgd1GDPQEUve+dshwr2kj8HvndbGEHrlxmjfWqlRa+dPnMYxUOQ9464g1HgdSrrYy ZpDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781785389; x=1782390189; 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=Q1uKl0CNvdgfWO0Mn4aUOTwFartpNuJZP4m4+2UlupY=; b=eMcrleTd9oTM4G0XFucIXQZeU6oWva8Sc+/ncwAMNWhGZey44FkLP8R4+JGI+6peIH ve4fHy8wmIUH25W8gw6n6ckRQ4e9qrBI9HRNHheoj5wJTtZJQGgnggGEnjKx+B8HPKnk fBpqJ5SdaxtoJ3NAnYbw8j91k7hgZUSgMGS2mgos6J3P6SArDNDFnwjutAQjYaCQGDRe Qf2eXZq7szcNb5HsBtjQ0g0ao18wjOwAPN0VdpoN5BSFhChF3eydCX6bkgA425wgRUFp 8EI5qhYoUa5XdmwMJThOPUYO7R0TU5tIQCl3dAA/qH9pgYcOPXLqCsKmDR2th7z34vkD uHWA== X-Gm-Message-State: AOJu0YxxOG4k/H2zHcWHgaze9kyR1zRhwYPdmjiHVau5iDOwlD7Krym9 BL0giYe9F97ovFoF0Cu66y2KkfiDQpfU/5+Wozfold7Jek3T0fNv0hncWSn6G6Acnb+00qoVuVI TN4vzwJE= X-Gm-Gg: AfdE7cllGKVf75eQpsl40gNTIlJv+QbGM2Pscq49TMzftERFyvKKeGar1iyZu0t9OxM Zk3H1VnzrGB5jmTspuLGsdPBdyZickwtNdhRf1ePTiHN2rTKnB8C9T0gyB0XnOJ1B5N/m+daHgO jcw6hAiCcvj0EbjBci7qYr6I41QzMET9IT9gOZ3otf9RhX7GSskClY88nFoNRAstFa/JDoB7s6v cugHc+tRLuKrzg2PKJyoIH+55qnK4PC2gGmqo8ZTfnL2Labr9NHwa1/r06I1udbBVoixDG7jzs7 LyqkbQh454KkOYBPcpLAgMsVJR1rRP7xOnQzIOyj6MlMbtZgLDuNJFrXMM4YNZgEvBBGWwekYd+ d27fnKICU2Xx4YJOEFxSZaPaMtJMwTfrAQgK8auyoN8HN+0Ks/ybnbYZtLTM+ORuDJ558hdz9FG ZjLT/9hSeP1Kd37qgvAOc7PK25QgaX X-Received: by 2002:a05:600c:19d3:b0:490:ba0a:1178 with SMTP id 5b1f17b1804b1-49238226533mr53189805e9.28.1781785389270; Thu, 18 Jun 2026 05:23:09 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2026 05:23:08 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz Subject: [PATCH 15/30] libcamera: software_isp: egl: Extend eGL::createTexture2D to understand floats Date: Thu, 18 Jun 2026 13:22:28 +0100 Message-ID: <20260618122245.946138-16-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 --- src/libcamera/egl.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp index 4da335a53..a5e59c09c 100644 --- a/src/libcamera/egl.cpp +++ b/src/libcamera/egl.cpp @@ -264,13 +264,29 @@ int eGL::createOutputDMABufTexture2D(eGLImage &eglImage, int fd) */ void eGL::createTexture2D(eGLImage &eglImage, void *data) { + GLenum format; + GLenum type = GL_UNSIGNED_BYTE; + ASSERT(tid_ == Thread::currentId()); glActiveTexture(eglImage.texture_unit_); glBindTexture(GL_TEXTURE_2D, eglImage.texture_); + switch (eglImage.format_) { + case GL_R16F: + format = GL_RED; + type = GL_HALF_FLOAT; + break; + case GL_RG8: + format = GL_RG; + break; + case GL_LUMINANCE: + format = GL_LUMINANCE; + break; + } + // Generate texture, bind, associate image to texture, configure, unbind - glTexImage2D(GL_TEXTURE_2D, 0, eglImage.format_, eglImage.width_, eglImage.height_, 0, eglImage.format_, GL_UNSIGNED_BYTE, data); + glTexImage2D(GL_TEXTURE_2D, 0, eglImage.format_, eglImage.width_, eglImage.height_, 0, format, type, data); // Nearest filtering glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);