@@ -269,6 +269,8 @@ int DebayerEGL::initBayerShaders(PixelFormat inputFormat, PixelFormat outputForm
getShaderVariableLocations();
+ setShaderUniformValues();
+
return 0;
}
@@ -376,7 +378,7 @@ uint32_t DebayerEGL::preferredInputStride(const PixelFormat &inputFormat, const
return info.stride(size.width, 0, 256);
}
-void DebayerEGL::setShaderVariableValues(eGLImage &eglImageIn, const DebayerParams ¶ms)
+void DebayerEGL::setShaderUniformValues()
{
/*
* Raw Bayer 8-bit, and packed raw Bayer 10-bit/12-bit formats
@@ -427,13 +429,6 @@ void DebayerEGL::setShaderVariableValues(eGLImage &eglImageIn, const DebayerPara
glVertexAttribPointer(attributeTexture_, 2, GL_FLOAT, GL_TRUE,
2 * sizeof(GLfloat), tcoordinates);
- /*
- * Set the sampler2D to the respective texture unit for each texutre
- * To simultaneously sample multiple textures we need to use multiple
- * texture units
- */
- glUniform1i(textureUniformBayerDataIn_, eglImageIn.texture_unit_uniform_id_);
-
/*
* These values are:
* firstRed = tex_bayer_first_red - bayer_8.vert
@@ -464,6 +459,16 @@ void DebayerEGL::setShaderVariableValues(eGLImage &eglImageIn, const DebayerPara
<< " textureUniformStep_.y " << Step[1]
<< " textureUniformStrideFactor_ " << Stride
<< " textureUniformProjMatrix_ " << textureUniformProjMatrix_;
+}
+
+void DebayerEGL::setShaderVariableValues(eGLImage &eglImageIn, const DebayerParams ¶ms)
+{
+ /*
+ * Set the sampler2D to the respective texture unit for each texutre
+ * To simultaneously sample multiple textures we need to use multiple
+ * texture units
+ */
+ glUniform1i(textureUniformBayerDataIn_, eglImageIn.texture_unit_uniform_id_);
/* Pre-transpose matrix for GLES 2.0. */
Matrix<float, 3, 3> ccm = params.combinedMatrix.transpose();
@@ -65,6 +65,7 @@ private:
static int getInputConfig(PixelFormat inputFormat, DebayerInputConfig &config);
int initBayerShaders(PixelFormat inputFormat, PixelFormat outputFormat);
void getShaderVariableLocations();
+ void setShaderUniformValues();
void setShaderVariableValues(eGLImage &eGLImageIn, const DebayerParams ¶ms);
int debayerGPU(FrameBuffer *input, FrameBuffer *output, const DebayerParams ¶ms, std::optional<MappedFrameBuffer> *mappedInputBuffer, std::optional<DmaSyncer> *inputBufferDmaSyncer);
This results in an approximately 1.15x performance increase. Signed-off-by: coolGi <remy.alipoursafari@collabora.com> --- src/libcamera/software_isp/debayer_egl.cpp | 21 +++++++++++++-------- src/libcamera/software_isp/debayer_egl.h | 1 + 2 files changed, 14 insertions(+), 8 deletions(-)