summaryrefslogtreecommitdiff
path: root/src/qcam/viewfinder_gl.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-09-16 17:03:46 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-10-04 22:51:45 +0300
commit0bc03960daf0d7e28d45513873e3d1feecbedbf6 (patch)
treec0901ee77cfeb75051b17e6a2f27bdd96d07ca90 /src/qcam/viewfinder_gl.h
parent440028d6c9a2e98234a71fee79c55791e1d2af2f (diff)
qcam: viewfinder_gl: Support #define in shaders
Prepare the infrastructure to support defining preprocessor macros in shaders: - Rename the fragmentShaderSrc_ member to fragmentShaderFile_ to reflect better that it contains a file name, not shader source code - Add a new fragmentShaderDefines_ member to store preprocessor macros - Prepend the macros to the shader source before compiling it Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/qcam/viewfinder_gl.h')
-rw-r--r--src/qcam/viewfinder_gl.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qcam/viewfinder_gl.h b/src/qcam/viewfinder_gl.h
index 7675d0a0..53424dc1 100644
--- a/src/qcam/viewfinder_gl.h
+++ b/src/qcam/viewfinder_gl.h
@@ -65,17 +65,16 @@ private:
QSize size_;
unsigned char *yuvData_;
- /* OpenGL components for rendering */
- QOpenGLShader *fragmentShader_;
- QOpenGLShader *vertexShader_;
+ /* Shaders */
QOpenGLShaderProgram shaderProgram_;
+ QOpenGLShader *vertexShader_;
+ QOpenGLShader *fragmentShader_;
+ QString fragmentShaderFile_;
+ QStringList fragmentShaderDefines_;
/* Vertex buffer */
QOpenGLBuffer vertexBuffer_;
- /* Fragment shader file name */
- QString fragmentShaderSrc_;
-
/* YUV texture planars and parameters */
GLuint textureUniformU_;
GLuint textureUniformV_;