From patchwork Tue Jun 22 13:46:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 12691 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 1E7E2C321B for ; Tue, 22 Jun 2021 13:47:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D51A660297; Tue, 22 Jun 2021 15:47:23 +0200 (CEST) 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="jyxWbuLj"; dkim-atps=neutral Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B5D8368EA3 for ; Tue, 22 Jun 2021 15:47:21 +0200 (CEST) Received: by mail-lj1-x22f.google.com with SMTP id d25so2155548lji.7 for ; Tue, 22 Jun 2021 06:47:21 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=TUbjnIpWP4fKLUmcH2E4fnC7KvY82GsTBNsUS9Q1Ci8=; b=jyxWbuLjsaLztD6QY8Gau75RzThsmGBscKM37caq55qbluKmw6O1D6Ny/WYz+cfOZ4 eEa0msMSaLNRNxH0qtKE8uk9lraML5mh4GEGejcoLS7HpXXcSvEaO6DUAHJrZEEmEofA il2fLXIqeHqn6iGECHiZNIOOEPpcuzV+VqBWGmjR2alk+iWwKEcFAdFjOmhueWaaFV2z hRAsepc4otrvVMMUqZfmOTnVd2/7yPK8tUjw/CnZ+1/XUyDlZRu4hqwLC6bbSkr5DZ7q G7xxABtq7RG/oLoJDqjCmkBH6TNaWHmmLAPvd/EYsPmMbcq6gtzTzTylFEm5sYHJFZEa QhQA== 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:mime-version:content-transfer-encoding; bh=TUbjnIpWP4fKLUmcH2E4fnC7KvY82GsTBNsUS9Q1Ci8=; b=S8dFzLIc2apteA5dBS5qcRhYUytlNjRcouHd27OHqcBa81f3BWDpZoy4xSZw6uTx+W zYJMnKFNqyiv9TF/NXhbHtlvlkkOittNWejoMIai/rzRA+rw1UPjCqWDBFLYZbYEXyrH Onlx+M1Ii/r23Qf3+twN37aHGAr1hzwYGrrxE0BlGpvo/RwaGI0FccVU1VmKqEsA9c9e ArM3l4AYjWzJeZ61PJJ8vwt9Tj8lk5SymqWD8EHcJ38y+MY3ombnBIxJJasStofM4LYD LZXqHlv9QQxR+zIRZOnWiqt8blJrtC6N1/Ga1l8PB1kHMHe7j4ALqp902kFwXFY6NNRp C63A== X-Gm-Message-State: AOAM530KAqhglNdLc6jWuaLBeo/SSsPNSRt/rcSz3sEWXavqLusxd7Bx dFQR0Ts2eW/69IP0nFJ1MEE7VEzn4bHCyQ== X-Google-Smtp-Source: ABdhPJyRhEiw46BhtJI6raddN8bX31/6Hg0kSN5finJLTQ8Eoe6x26nLVaCLcLvF9MC30E6MVK+o/A== X-Received: by 2002:a2e:bc0b:: with SMTP id b11mr3351501ljf.131.1624369641244; Tue, 22 Jun 2021 06:47:21 -0700 (PDT) Received: from localhost.localdomain ([85.249.44.185]) by smtp.googlemail.com with ESMTPSA id b19sm163125ljo.37.2021.06.22.06.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 06:47:20 -0700 (PDT) From: Andrey Konovalov To: libcamera-devel@lists.libcamera.org, laurent.pinchart@ideasonboard.com Date: Tue, 22 Jun 2021 16:46:50 +0300 Message-Id: <20210622134652.1279260-8-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210622134652.1279260-1-andrey.konovalov@linaro.org> References: <20210622134652.1279260-1-andrey.konovalov@linaro.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 7/9] 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: , Cc: morgan@casual-effects.com 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: Paul Elder Reviewed-by: Laurent Pinchart --- src/qcam/viewfinder_gl.cpp | 5 ++++- src/qcam/viewfinder_gl.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp index a6aa2b44..6d1d80bd 100644 --- a/src/qcam/viewfinder_gl.cpp +++ b/src/qcam/viewfinder_gl.cpp @@ -131,6 +131,9 @@ bool ViewFinderGL::selectFormat(const libcamera::PixelFormat &format) /* Set min/mag filters to GL_LINEAR by default. */ textureMinMagFilters_ = GL_LINEAR; + /* Use identity.vert as the default vertex shader. */ + vertexShaderFile_ = ":identity.vert"; + fragmentShaderDefines_.clear(); switch (format) { @@ -292,7 +295,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 508155b1..bce94c87 100644 --- a/src/qcam/viewfinder_gl.h +++ b/src/qcam/viewfinder_gl.h @@ -73,6 +73,7 @@ private: QOpenGLShaderProgram shaderProgram_; std::unique_ptr vertexShader_; std::unique_ptr fragmentShader_; + QString vertexShaderFile_; QString fragmentShaderFile_; QStringList fragmentShaderDefines_;