diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-09-16 16:24:54 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-10-04 22:51:45 +0300 |
commit | 079afd17e7d8775efc809ec9ca4c6a3fcb4d2763 (patch) | |
tree | ebd3661af1454b8263b165b9f5963ca708bb7df5 /src/qcam | |
parent | 52f2581709365992ae54430f2b9563269c2fbfce (diff) |
qcam: viewfinder_gl: Hardcode the vertex shader file name
The GL renderer uses the same vertex shader for all formats. Hardcode
the file name instead of storing it in a member variable.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/qcam')
-rw-r--r-- | src/qcam/viewfinder_gl.cpp | 10 | ||||
-rw-r--r-- | src/qcam/viewfinder_gl.h | 3 |
2 files changed, 2 insertions, 11 deletions
diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp index 18ebe46f..76e4a900 100644 --- a/src/qcam/viewfinder_gl.cpp +++ b/src/qcam/viewfinder_gl.cpp @@ -101,49 +101,41 @@ bool ViewFinderGL::selectFormat(const libcamera::PixelFormat &format) case libcamera::formats::NV12: horzSubSample_ = 2; vertSubSample_ = 2; - vertexShaderSrc_ = ":NV_vertex_shader.glsl"; fragmentShaderSrc_ = ":NV_2_planes_UV_f.glsl"; break; case libcamera::formats::NV21: horzSubSample_ = 2; vertSubSample_ = 2; - vertexShaderSrc_ = ":NV_vertex_shader.glsl"; fragmentShaderSrc_ = ":NV_2_planes_VU_f.glsl"; break; case libcamera::formats::NV16: horzSubSample_ = 2; vertSubSample_ = 1; - vertexShaderSrc_ = ":NV_vertex_shader.glsl"; fragmentShaderSrc_ = ":NV_2_planes_UV_f.glsl"; break; case libcamera::formats::NV61: horzSubSample_ = 2; vertSubSample_ = 1; - vertexShaderSrc_ = ":NV_vertex_shader.glsl"; fragmentShaderSrc_ = ":NV_2_planes_VU_f.glsl"; break; case libcamera::formats::NV24: horzSubSample_ = 1; vertSubSample_ = 1; - vertexShaderSrc_ = ":NV_vertex_shader.glsl"; fragmentShaderSrc_ = ":NV_2_planes_UV_f.glsl"; break; case libcamera::formats::NV42: horzSubSample_ = 1; vertSubSample_ = 1; - vertexShaderSrc_ = ":NV_vertex_shader.glsl"; fragmentShaderSrc_ = ":NV_2_planes_VU_f.glsl"; break; case libcamera::formats::YUV420: horzSubSample_ = 2; vertSubSample_ = 2; - vertexShaderSrc_ = ":NV_vertex_shader.glsl"; fragmentShaderSrc_ = ":NV_3_planes_f.glsl"; break; case libcamera::formats::YVU420: horzSubSample_ = 2; vertSubSample_ = 2; - vertexShaderSrc_ = ":NV_vertex_shader.glsl"; fragmentShaderSrc_ = ":NV_3_planes_f.glsl"; break; default: @@ -162,7 +154,7 @@ bool ViewFinderGL::createVertexShader() vertexShader_ = new QOpenGLShader(QOpenGLShader::Vertex, this); /* Compile the vertex shader */ - if (!vertexShader_->compileSourceFile(vertexShaderSrc_)) { + if (!vertexShader_->compileSourceFile(":NV_vertex_shader.glsl")) { qWarning() << "[ViewFinderGL]:" << vertexShader_->log(); return false; } diff --git a/src/qcam/viewfinder_gl.h b/src/qcam/viewfinder_gl.h index 825af1c1..7675d0a0 100644 --- a/src/qcam/viewfinder_gl.h +++ b/src/qcam/viewfinder_gl.h @@ -73,9 +73,8 @@ private: /* Vertex buffer */ QOpenGLBuffer vertexBuffer_; - /* Fragment and Vertex shader file name */ + /* Fragment shader file name */ QString fragmentShaderSrc_; - QString vertexShaderSrc_; /* YUV texture planars and parameters */ GLuint textureUniformU_; |