From patchwork Mon Aug 10 10:59:35 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: 27723 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 CC6E1BE080 for ; Mon, 10 Aug 2026 10:59:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 96D76681B5; Mon, 10 Aug 2026 12:59:50 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oWniou1j"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6F718681AF for ; Mon, 10 Aug 2026 12:59:46 +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 5AC401F8; Mon, 10 Aug 2026 12:58:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1786359512; bh=xyQQHSwnAGPbBILOJJLiDhhjw28voxfdkz0e30YJFr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oWniou1jpjMiUyCxAb4kdGX5oWLALeFnLgkQN1KphVyMol5ScVZFL2Oue4o2NFrU/ if3tpWchTL8f0yIRVQ7OSOCwhApdWWar7hmRO5c7EP+ynYOYfL7pEkDNnmHDI8rzOg Naydi5HNBNFx2rJJb8elofM+yvXaao5/X39tXYbs= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [RFC PATCH v2 1/8] libcamera: egl: Remove `gl{Use, Delete}Program()` Date: Mon, 10 Aug 2026 12:59:35 +0200 Message-ID: <20260810105942.1098192-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260810105942.1098192-1-barnabas.pocze@ideasonboard.com> References: <20260810105942.1098192-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 Reviewed-by: Milan Zamazal --- 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;