[{"id":14151,"web_url":"https://patchwork.libcamera.org/comment/14151/","msgid":"<X8/BvqHVG4pqb1eb@pendragon.ideasonboard.com>","date":"2020-12-08T18:11:10","subject":"Re: [libcamera-devel] [PATCH][RFC 1/2] qcam: viewfinder_gl: set the\n\tvertex shader file name in selectFormat()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Andrey,\n\nThank you for the patch.\n\nOn Tue, Nov 10, 2020 at 12:34:10AM +0300, Andrey Konovalov wrote:\n> In preparation to extend the supported formats, make it possible\n> to use different vertex fragment files depending on the format.\n> Make \"identity.vert\" the default choice.\n> \n> Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/qcam/viewfinder_gl.cpp | 4 +++-\n>  src/qcam/viewfinder_gl.h   | 1 +\n>  2 files changed, 4 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp\n> index 5d9b442e..c74ce77b 100644\n> --- a/src/qcam/viewfinder_gl.cpp\n> +++ b/src/qcam/viewfinder_gl.cpp\n> @@ -114,6 +114,8 @@ bool ViewFinderGL::selectFormat(const libcamera::PixelFormat &format)\n>  {\n>  \tbool ret = true;\n>  \n> +\tvertexShaderFile_ = \":identity.vert\";\n> +\n>  \tfragmentShaderDefines_.clear();\n>  \n>  \tswitch (format) {\n> @@ -219,7 +221,7 @@ bool ViewFinderGL::createVertexShader()\n>  \tvertexShader_ = std::make_unique<QOpenGLShader>(QOpenGLShader::Vertex, this);\n>  \n>  \t/* Compile the vertex shader */\n> -\tif (!vertexShader_->compileSourceFile(\":identity.vert\")) {\n> +\tif (!vertexShader_->compileSourceFile(vertexShaderFile_)) {\n>  \t\tqWarning() << \"[ViewFinderGL]:\" << vertexShader_->log();\n>  \t\treturn false;\n>  \t}\n> diff --git a/src/qcam/viewfinder_gl.h b/src/qcam/viewfinder_gl.h\n> index 150fa4ae..6cf8f347 100644\n> --- a/src/qcam/viewfinder_gl.h\n> +++ b/src/qcam/viewfinder_gl.h\n> @@ -72,6 +72,7 @@ private:\n>  \tQOpenGLShaderProgram shaderProgram_;\n>  \tstd::unique_ptr<QOpenGLShader> vertexShader_;\n>  \tstd::unique_ptr<QOpenGLShader> fragmentShader_;\n> +\tQString vertexShaderFile_;\n>  \tQString fragmentShaderFile_;\n>  \tQStringList fragmentShaderDefines_;\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id E7815BDB20\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Dec 2020 18:11:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6CA6367F0C;\n\tTue,  8 Dec 2020 19:11:15 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5C4D967F08\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Dec 2020 19:11:14 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C7A6E543;\n\tTue,  8 Dec 2020 19:11:13 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"FWGEeDPr\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1607451074;\n\tbh=fzqFO0glOS4k6vhmfc8gaAJa34rTfKfHL4hdgaQ8834=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=FWGEeDPrcbeN59Kvc/p4IShZ14H+Mn7SusbjojaAHiogf6zvoNSgfmYBg1JwpBvwx\n\tvdoNFDHGQMDgkwupalGqABqsD8/QsoYAuoOaAq+9O68q1dAHIK3jKKfCZX54ginbio\n\tLMUcDN88VOlSyF6LFx3PiRlbTJcVS00UnErAn4iM=","Date":"Tue, 8 Dec 2020 20:11:10 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Andrey Konovalov <andrey.konovalov@linaro.org>","Message-ID":"<X8/BvqHVG4pqb1eb@pendragon.ideasonboard.com>","References":"<20201109213411.30987-1-andrey.konovalov@linaro.org>\n\t<20201109213411.30987-2-andrey.konovalov@linaro.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201109213411.30987-2-andrey.konovalov@linaro.org>","Subject":"Re: [libcamera-devel] [PATCH][RFC 1/2] qcam: viewfinder_gl: set the\n\tvertex shader file name in selectFormat()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]