[3/6] libcamera: software_isp: debayer_egl: Check GL_RG support
diff mbox series

Message ID 20261126110422.362455-4-remy.alipoursafari@collabora.com
State New
Headers show
Series
  • benchmark: Add GPU benchmarking to SoftISP eGL
Related show

Commit Message

Remy Alipoursafari Nov. 26, 2026, 11:03 a.m. UTC
From: Loïc Molinari <loic.molinari@collabora.com>

Unpacked 10 and 12-bit raw input formats require either OpenGL ES 3.0
or the GL_EXT_texture_rg extension.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Robert Mader <robert.mader@collabora.com>
---
 src/libcamera/software_isp/debayer_egl.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

Patch
diff mbox series

diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
index 33933b11..d94a06d1 100644
--- a/src/libcamera/software_isp/debayer_egl.cpp
+++ b/src/libcamera/software_isp/debayer_egl.cpp
@@ -244,6 +244,13 @@  int DebayerEGL::initBayerShaders(PixelFormat inputFormat, PixelFormat outputForm
 		break;
 	};
 
+	/* GL_RG textures need GL_EXT_texture_rg before ES 3.0 */
+	if (glFormat_ == GL_RG && !egl_.hasGLESVersion(3, 0) &&
+	    !egl_.hasGLESExtension("GL_EXT_texture_rg")) {
+		LOG(Debayer, Error) << "GL_EXT_texture_rg not supported for unpacked input format";
+		return -EINVAL;
+	}
+
 	if (egl_.compileVertexShader(vertexShaderId_, vertexShaderData,
 				     shaderEnv)) {
 		LOG(Debayer, Error) << "Compile vertex shader fail";