From patchwork Mon Nov 9 21:34:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 10398 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 08BDFBE082 for ; Mon, 9 Nov 2020 21:34:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C7A166308D; Mon, 9 Nov 2020 22:34:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="K9V4FC2j"; dkim-atps=neutral Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 65E166308C for ; Mon, 9 Nov 2020 22:34:35 +0100 (CET) Received: by mail-lf1-x133.google.com with SMTP id j205so7160465lfj.6 for ; Mon, 09 Nov 2020 13:34:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0xA1q7Ea1OuZBRCqd+rTh+kWrABq3xVfytDIebb7Css=; b=K9V4FC2jG0muxiSZCtxBZt2Xry4x9WsgDgGiSi2EIzw9X/qVQLAhXIk0wY9IaLCxg9 CHpEtw4bW3qYl94wSqe1xBphRwcZEItQhGXar+yBGs3BplFn74eQDyymGYFGAhuVV1x0 eaStDSII3RVcFwOeVg7+HRMdtuHS+s15TG3S4NNks2mG8s2JhL3Ap+yvgaJ2ulDih7vP tCrRy7JxP1sMXFG34nnq0bJAAj3+mHSjp1vJJZNhDlYvOu9kSLnBUJwu0mZ4osI2f5qW dF7Nix3bSYLi691XypqgfQkhrF26wWkIBFFejh0Gc5dhpSHX6ffQYc+F+hqFkM9CRUnA pVVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0xA1q7Ea1OuZBRCqd+rTh+kWrABq3xVfytDIebb7Css=; b=bcpQRiM5D7v8beWXwEr44ktPIsmVXG5I+m4XQda6GogqQFMHJ6L+QEfELqB1yNOarm rRFQb/ReUJ+I+WPPg+CB4aVbViCl3OfS1qm+gcWHmOpSM0sULF2F41LMX7gBPlNosClR b6zrWCz7GWMeL/toWPPYz4bW5nLfEK1LkzQTEE8OPHy+A5gR9DU/0Oz4MaAFws9z7jsk bCsMwVWPpVLyZyMYNsmIvaMjEOX1KTjsMzUgvQpE+VhI+OZzDHRsOq/veDH7a9EtYaDN HIXdJ1vfNtWmhqFtW0dBgveSN56DiPDVhivreHUhGY6JG5se7Qi58c90u/I1LbXkH3gK LpkA== X-Gm-Message-State: AOAM531nqzybz1YfcSFQwO2vADnRnIjVHXaikvbXGbFWKjNa99TWUOJX FeO+/OxYbQAATMBN3zdIquBkSFaAoKYA+g== X-Google-Smtp-Source: ABdhPJwCXq+TRdDH+3EXgUtcZxW8ZKWbn3I6MICaECYpimwKO8+jn+39LrQiT/Um9EuPUjo2wyXFSg== X-Received: by 2002:ac2:5185:: with SMTP id u5mr1975831lfi.433.1604957674195; Mon, 09 Nov 2020 13:34:34 -0800 (PST) Received: from localhost.localdomain ([85.249.41.73]) by smtp.googlemail.com with ESMTPSA id c1sm1375986lfj.222.2020.11.09.13.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 13:34:33 -0800 (PST) From: Andrey Konovalov To: libcamera-devel@lists.libcamera.org Date: Tue, 10 Nov 2020 00:34:10 +0300 Message-Id: <20201109213411.30987-2-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201109213411.30987-1-andrey.konovalov@linaro.org> References: <20201109213411.30987-1-andrey.konovalov@linaro.org> Subject: [libcamera-devel] [PATCH][RFC 1/2] qcam: viewfinder_gl: set the vertex shader file name in selectFormat() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" In preparation to extend the supported formats, make it possible to use different vertex fragment files depending on the format. Make "identity.vert" the default choice. Signed-off-by: Andrey Konovalov Reviewed-by: Laurent Pinchart --- src/qcam/viewfinder_gl.cpp | 4 +++- src/qcam/viewfinder_gl.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp index 5d9b442e..c74ce77b 100644 --- a/src/qcam/viewfinder_gl.cpp +++ b/src/qcam/viewfinder_gl.cpp @@ -114,6 +114,8 @@ bool ViewFinderGL::selectFormat(const libcamera::PixelFormat &format) { bool ret = true; + vertexShaderFile_ = ":identity.vert"; + fragmentShaderDefines_.clear(); switch (format) { @@ -219,7 +221,7 @@ bool ViewFinderGL::createVertexShader() vertexShader_ = std::make_unique(QOpenGLShader::Vertex, this); /* Compile the vertex shader */ - if (!vertexShader_->compileSourceFile(":identity.vert")) { + if (!vertexShader_->compileSourceFile(vertexShaderFile_)) { qWarning() << "[ViewFinderGL]:" << vertexShader_->log(); return false; } diff --git a/src/qcam/viewfinder_gl.h b/src/qcam/viewfinder_gl.h index 150fa4ae..6cf8f347 100644 --- a/src/qcam/viewfinder_gl.h +++ b/src/qcam/viewfinder_gl.h @@ -72,6 +72,7 @@ private: QOpenGLShaderProgram shaderProgram_; std::unique_ptr vertexShader_; std::unique_ptr fragmentShader_; + QString vertexShaderFile_; QString fragmentShaderFile_; QStringList fragmentShaderDefines_;