diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-09-16 16:23:27 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-10-04 22:51:45 +0300 |
commit | 440028d6c9a2e98234a71fee79c55791e1d2af2f (patch) | |
tree | 759442f16b82d06e81971a3f4df2aeabbe923c0e /src | |
parent | 079afd17e7d8775efc809ec9ca4c6a3fcb4d2763 (diff) |
qcam: viewfinder_gl: Rename shader files
Rename shader files to prepare for packed YUYV support:
- The NV prefix isn't a good match for packed (or for 3-planar) formats,
replace it with a YUV prefix
- Use .frag and .vert extensions to differentiate between fragment and
vertex shaders
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src')
-rw-r--r-- | src/qcam/assets/shader/YUV.vert (renamed from src/qcam/assets/shader/NV_vertex_shader.glsl) | 2 | ||||
-rw-r--r-- | src/qcam/assets/shader/YUV_2_planes_UV.frag (renamed from src/qcam/assets/shader/NV_2_planes_UV_f.glsl) | 2 | ||||
-rw-r--r-- | src/qcam/assets/shader/YUV_2_planes_VU.frag (renamed from src/qcam/assets/shader/NV_2_planes_VU_f.glsl) | 2 | ||||
-rw-r--r-- | src/qcam/assets/shader/YUV_3_planes.frag (renamed from src/qcam/assets/shader/NV_3_planes_f.glsl) | 2 | ||||
-rw-r--r-- | src/qcam/assets/shader/shaders.qrc | 8 | ||||
-rw-r--r-- | src/qcam/viewfinder_gl.cpp | 18 |
6 files changed, 17 insertions, 17 deletions
diff --git a/src/qcam/assets/shader/NV_vertex_shader.glsl b/src/qcam/assets/shader/YUV.vert index 12e791e3..f38e8045 100644 --- a/src/qcam/assets/shader/NV_vertex_shader.glsl +++ b/src/qcam/assets/shader/YUV.vert @@ -2,7 +2,7 @@ /* * Copyright (C) 2020, Linaro * - * NV_vertex_shader.glsl - Vertex shader code for NV family + * YUV.vert - Vertex shader for YUV to RGB conversion */ attribute vec4 vertexIn; diff --git a/src/qcam/assets/shader/NV_2_planes_UV_f.glsl b/src/qcam/assets/shader/YUV_2_planes_UV.frag index 67633a11..081caea9 100644 --- a/src/qcam/assets/shader/NV_2_planes_UV_f.glsl +++ b/src/qcam/assets/shader/YUV_2_planes_UV.frag @@ -2,7 +2,7 @@ /* * Copyright (C) 2020, Linaro * - * NV_2_planes_UV_f.glsl - Fragment shader code for NV12, NV16 and NV24 formats + * YUV_2_planes_UV.frag - Fragment shader code for NV12, NV16 and NV24 formats */ #ifdef GL_ES diff --git a/src/qcam/assets/shader/NV_2_planes_VU_f.glsl b/src/qcam/assets/shader/YUV_2_planes_VU.frag index 086c5b6d..f4a5a5ac 100644 --- a/src/qcam/assets/shader/NV_2_planes_VU_f.glsl +++ b/src/qcam/assets/shader/YUV_2_planes_VU.frag @@ -2,7 +2,7 @@ /* * Copyright (C) 2020, Linaro * - * NV_2_planes_VU_f.glsl - Fragment shader code for NV21, NV61 and NV42 formats + * YUV_2_planes_VU.frag - Fragment shader code for NV21, NV61 and NV42 formats */ #ifdef GL_ES diff --git a/src/qcam/assets/shader/NV_3_planes_f.glsl b/src/qcam/assets/shader/YUV_3_planes.frag index 4bc94184..2be74b5d 100644 --- a/src/qcam/assets/shader/NV_3_planes_f.glsl +++ b/src/qcam/assets/shader/YUV_3_planes.frag @@ -2,7 +2,7 @@ /* * Copyright (C) 2020, Linaro * - * NV_3_planes_UV_f.glsl - Fragment shader code for YUV420 format + * YUV_3_planes_UV.frag - Fragment shader code for YUV420 format */ #ifdef GL_ES diff --git a/src/qcam/assets/shader/shaders.qrc b/src/qcam/assets/shader/shaders.qrc index 9ae35c9f..533396d1 100644 --- a/src/qcam/assets/shader/shaders.qrc +++ b/src/qcam/assets/shader/shaders.qrc @@ -1,9 +1,9 @@ <!-- SPDX-License-Identifier: LGPL-2.1-or-later --> <!DOCTYPE RCC><RCC version="1.0"> <qresource> - <file>NV_vertex_shader.glsl</file> - <file>NV_2_planes_UV_f.glsl</file> - <file>NV_2_planes_VU_f.glsl</file> - <file>NV_3_planes_f.glsl</file> + <file>YUV.vert</file> + <file>YUV_2_planes_UV.frag</file> + <file>YUV_2_planes_VU.frag</file> + <file>YUV_3_planes.frag</file> </qresource> </RCC> diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp index 76e4a900..0fa06a29 100644 --- a/src/qcam/viewfinder_gl.cpp +++ b/src/qcam/viewfinder_gl.cpp @@ -101,42 +101,42 @@ bool ViewFinderGL::selectFormat(const libcamera::PixelFormat &format) case libcamera::formats::NV12: horzSubSample_ = 2; vertSubSample_ = 2; - fragmentShaderSrc_ = ":NV_2_planes_UV_f.glsl"; + fragmentShaderSrc_ = ":YUV_2_planes_UV.frag"; break; case libcamera::formats::NV21: horzSubSample_ = 2; vertSubSample_ = 2; - fragmentShaderSrc_ = ":NV_2_planes_VU_f.glsl"; + fragmentShaderSrc_ = ":YUV_2_planes_VU.frag"; break; case libcamera::formats::NV16: horzSubSample_ = 2; vertSubSample_ = 1; - fragmentShaderSrc_ = ":NV_2_planes_UV_f.glsl"; + fragmentShaderSrc_ = ":YUV_2_planes_UV.frag"; break; case libcamera::formats::NV61: horzSubSample_ = 2; vertSubSample_ = 1; - fragmentShaderSrc_ = ":NV_2_planes_VU_f.glsl"; + fragmentShaderSrc_ = ":YUV_2_planes_VU.frag"; break; case libcamera::formats::NV24: horzSubSample_ = 1; vertSubSample_ = 1; - fragmentShaderSrc_ = ":NV_2_planes_UV_f.glsl"; + fragmentShaderSrc_ = ":YUV_2_planes_UV.frag"; break; case libcamera::formats::NV42: horzSubSample_ = 1; vertSubSample_ = 1; - fragmentShaderSrc_ = ":NV_2_planes_VU_f.glsl"; + fragmentShaderSrc_ = ":YUV_2_planes_VU.frag"; break; case libcamera::formats::YUV420: horzSubSample_ = 2; vertSubSample_ = 2; - fragmentShaderSrc_ = ":NV_3_planes_f.glsl"; + fragmentShaderSrc_ = ":YUV_3_planes.frag"; break; case libcamera::formats::YVU420: horzSubSample_ = 2; vertSubSample_ = 2; - fragmentShaderSrc_ = ":NV_3_planes_f.glsl"; + fragmentShaderSrc_ = ":YUV_3_planes.frag"; break; default: ret = false; @@ -154,7 +154,7 @@ bool ViewFinderGL::createVertexShader() vertexShader_ = new QOpenGLShader(QOpenGLShader::Vertex, this); /* Compile the vertex shader */ - if (!vertexShader_->compileSourceFile(":NV_vertex_shader.glsl")) { + if (!vertexShader_->compileSourceFile(":YUV.vert")) { qWarning() << "[ViewFinderGL]:" << vertexShader_->log(); return false; } |