[RFC,v1,01/10] libcamera: egl: Remove `gl{Use, Delete}Program()`
diff mbox series

Message ID 20260804101949.353266-2-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • libcamera: software_isp: debayer_egl: Remove some leaks
Related show

Commit Message

Barnabás Pőcze Aug. 4, 2026, 10:19 a.m. UTC
`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 <barnabas.pocze@ideasonboard.com>
---
 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(-)

Patch
diff mbox series

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<const std::string> 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;