[RFC,v2,07/26] libcamera: software_isp: gpu_pipeline_shader_pass: Move common attribute and uniform variables to base shader class
diff mbox series

Message ID 20261118095735.170587-8-bryan.odonoghue@linaro.org
State New
Headers show
Series
  • gpuisp multipass + fixes
Related show

Commit Message

Bryan O'Donoghue Nov. 18, 2026, 9:57 a.m. UTC
Every shader pass will want to set these variables so define them in the
base class not in the demosiac class.

Render therefore unto Cesar the things which are Cesar's.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 .../software_isp/gpu_pipeline_shader_pass.h         | 13 +++++++++++++
 .../gpu_pipeline_shader_pass_demosiac.h             | 10 ----------
 2 files changed, 13 insertions(+), 10 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/software_isp/gpu_pipeline_shader_pass.h b/src/libcamera/software_isp/gpu_pipeline_shader_pass.h
index 5e3748621..9611edc84 100644
--- a/src/libcamera/software_isp/gpu_pipeline_shader_pass.h
+++ b/src/libcamera/software_isp/gpu_pipeline_shader_pass.h
@@ -80,6 +80,19 @@  protected:
 
 	struct PassConfig passInputCfg_;
 	struct PassConfig passOutputCfg_;
+
+	/* Common shader attributes */
+	GLint attributeVertex_;
+	GLint attributeTexture_;
+	GLint textureUniformProjMatrix_;
+	GLint textureUniformBayerDataIn_;
+	GLint textureUniformStrideFactor_;
+	uint32_t shaderStridePixels_;
+
+	/* Bayer shader parameters - useful to potentially more than one shader */
+	GLint textureUniformBayerFirstRed_;
+	float firstRed_x_;
+	float firstRed_y_;
 };
 
 } /* namespace libcamera */
diff --git a/src/libcamera/software_isp/gpu_pipeline_shader_pass_demosiac.h b/src/libcamera/software_isp/gpu_pipeline_shader_pass_demosiac.h
index 97f84d444..a4c0befe6 100644
--- a/src/libcamera/software_isp/gpu_pipeline_shader_pass_demosiac.h
+++ b/src/libcamera/software_isp/gpu_pipeline_shader_pass_demosiac.h
@@ -44,18 +44,8 @@  public:
 	const char *name() const override { return "GpuIspShaderPassDemosiac"; }
 private:
 	/* Shader parameters */
-	float firstRed_x_;
-	float firstRed_y_;
-	GLint attributeVertex_;
-	GLint attributeTexture_;
 	GLint textureUniformStep_;
 	GLint textureUniformSize_;
-	GLint textureUniformStrideFactor_;
-	GLint textureUniformBayerFirstRed_;
-	GLint textureUniformProjMatrix_;
-	GLint textureUniformBayerDataIn_;
-
-	uint32_t shaderStridePixels_;
 
 	/* Per-frame AWB gains */
 	GLint awbUniformDataIn_;