From patchwork Tue Aug 4 10:19:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 27603 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 CE91CC3301 for ; Tue, 4 Aug 2026 10:19:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8D42E6808A; Tue, 4 Aug 2026 12:19:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="NtUQA11Q"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7A0396807C for ; Tue, 4 Aug 2026 12:19:52 +0200 (CEST) Received: from pb-laptop.local (185.221.141.208.nat.pool.zt.hu [185.221.141.208]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D69B91CDD for ; Tue, 4 Aug 2026 12:18:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1785838722; bh=7VqqfGmzBTKtmeNiIcMS4kf7Ey5jqn2XzCeznL+segA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NtUQA11Qh52LSI8oAvKhFHhaBQy9XjDbV8wFKGb5fTl2CuCgA+B7CexokLMHjHnIV +asqy2hsVKGIS6bROdlaOKrgUq0CEU4sX8Zj97Ynq/s65WrFoyTVM7dIKWoy7PLtpc YugqNG/Fgx4uefMh+/MPNfWuq0dh0+NPc6dc4fuk= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 01/10] libcamera: egl: Remove `gl{Use, Delete}Program()` Date: Tue, 4 Aug 2026 12:19:40 +0200 Message-ID: <20260804101949.353266-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260804101949.353266-1-barnabas.pocze@ideasonboard.com> References: <20260804101949.353266-1-barnabas.pocze@ideasonboard.com> 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" `eGL::deleteProgram()` is currently unused, and the only user of `eGL::useProgram()` is `debayer_egl.cpp`, which is already using numerous gl calls directly without going through the `eGL` type. So remove these trivial wrappers. Signed-off-by: Barnabás Pőcze --- include/libcamera/internal/egl.h | 2 -- src/libcamera/egl.cpp | 28 ---------------------- src/libcamera/software_isp/debayer_egl.cpp | 2 +- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h index 7ef1ca0d93..c43684808d 100644 --- a/include/libcamera/internal/egl.h +++ b/include/libcamera/internal/egl.h @@ -123,8 +123,6 @@ public: Span shaderEnv); int linkProgram(GLuint &programId, GLuint fragmentshaderId, GLuint vertexshaderId); void dumpShaderSource(GLuint shaderId); - void useProgram(GLuint programId); - void deleteProgram(GLuint programId); void syncOutput(); void flushOutput(); diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp index 01e51cda8e..780b7bc2d5 100644 --- a/src/libcamera/egl.cpp +++ b/src/libcamera/egl.cpp @@ -464,34 +464,6 @@ void eGL::makeCurrent() } } -/** - * \brief Activate a shader program for rendering - * \param[in] programId OpenGL program object ID - * - * Sets the specified program as the current rendering program. All - * subsequent draw calls will use this program's shaders. - */ -void eGL::useProgram(GLuint programId) -{ - ASSERT(tid_ == Thread::currentId()); - - glUseProgram(programId); -} - -/** - * \brief Delete a shader program - * \param[in] programId OpenGL program object ID - * - * Deletes a shader program and frees associated resources. The program - * must not be currently in use. - */ -void eGL::deleteProgram(GLuint programId) -{ - ASSERT(tid_ == Thread::currentId()); - - glDeleteProgram(programId); -} - /** * \brief Add a preprocessor definition to shader environment * \param[in,out] shaderEnv Vector of shader environment strings diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp index 20b478b1c3..ede3be2352 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -261,7 +261,7 @@ int DebayerEGL::initBayerShaders(PixelFormat inputFormat, PixelFormat outputForm egl_.dumpShaderSource(fragmentShaderId_); /* Ensure we set the programId_ */ - egl_.useProgram(programId_); + glUseProgram(programId_); err = glGetError(); if (err != GL_NO_ERROR) { LOG(Debayer, Error) << "Use program error " << err;