From patchwork Thu Jun 18 12:22:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 26943 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 BD6BAC3306 for ; Thu, 18 Jun 2026 12:23:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C65E462FE1; Thu, 18 Jun 2026 14:23:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="SmELQWAg"; dkim-atps=neutral Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5CD1C62C6A for ; Thu, 18 Jun 2026 14:23:05 +0200 (CEST) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-490b211ee6aso5484755e9.3 for ; Thu, 18 Jun 2026 05:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1781785385; x=1782390185; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EnOXXDwDQkS4RkeO0LXcAjFKNLZWffOHcAAqtwXY+iY=; b=SmELQWAgY+xgxDCfYU60R9K/ija50q280AF3H6LlEehyiezpCGBdD2m6bbsUDFrtw1 Xqk2a+C8lNb3TGaDDxj0/YqxgEEsqyBQM8FNVzT8hb9n0rT09Pxot4aSFqAYt4YvzxHB 7GRy1JnEGuXpBWSYsHhmWEOKmvT0O2mOqGpzwmNylL0HS4ISt4YxiYLBlQtaqj7dvmej gHy2iGRbm1bzjOrruEaF6mSiw0NwUjDYhhq766o2T2n6XNvuKjR9Vh33qRi2VBfkPKPD WvxssLleNRCONlaAzbZgqA0Nvde9Fu8wyNHW7fUlRSgOzL2AZVAG7VXwPZYsFDIoPN+u K/Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781785385; x=1782390185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EnOXXDwDQkS4RkeO0LXcAjFKNLZWffOHcAAqtwXY+iY=; b=jsFYvCiG5Tm6u7LfgRWL2XBNZ2QrG0dAGvhU4ZmqauAIasfT/9J2pMhLtY7mRd/qlV 1qvB5ZzM7jVxJpdSqbGYaC3tmMw2BPpsWwQrvvkJHQJYHJRHczrc19A5XWOmmH3h34ox 3R4sNwgen2QoPvEKykVt2OJo1EuXAvxFa5tUUi5lXaHgat+GvS2uBLqnzqIO3vQ/tHJW SybGxeNgtv7ByTR5SPWtMD9WHnYM5tQBkGNrGzoZSWy+cOg4vpjtZ+qTkNuXVaWuByrU qKFF12QCwaTcOEPnGcbDT0QKRceo0ozxLPnfCDYp8CgbDUEph31QebowozxKuYb2QJvU +yCQ== X-Gm-Message-State: AOJu0YzgvQE6sYPA1eZEV7MaPJRJnAd3MizkPpFDvmwDBQNX7ArVS5nj LezL9skEbkUcic1zqeli9E1/Fk1rUgppcqxeHYX1MwG0NicBMuSwcnEgZ3I+RjSFKA2Jl3A5iir xdwktzFM= X-Gm-Gg: AfdE7cl7g/z/FhktoAjDEaqeDTtX6YSjjuFOmPJy7qF41woj9/2c4TOY4YsSWvEN6Jy 2v6gnFzRxEgG26CEmLH9FKzMGb2W88Ff10Q/jVt04cmhcRaF3UkCQtmTeCMPCIsskHC4f0cagh/ T1v+2yR6l1phyuPf3cc24OEABhdb/uBIJU1AHocSc4LgX/C8644k1WdzHf7zvVDQwuDelHJnUbg nvLlnlvsPXlb6VG/3yr8UMpfaP785r+fdXnwrHEMapfPCixH+NSeve0f3ckB7SqqJuD8vqWFDm+ INhvddOtjRs7ywAWuMpuTVee4IUGclm5/qQIIPkdhQnneQC6zqua/+C62tQqb883d5sCHgZaDZ8 BVX50BfD8aUrHMzdyyT7FDRRAm4YHybvXe26QsZBTc7oG3KUz9GjgPeEAV5H52Z/HlwX9JfnPOQ TBKXW8DRN/deGYg/sG3u9mVhNOxFtG X-Received: by 2002:a05:600c:1e0f:b0:490:e5c1:b88d with SMTP id 5b1f17b1804b1-492333babfbmr148393635e9.1.1781785384740; Thu, 18 Jun 2026 05:23:04 -0700 (PDT) Received: from inspiron14p-linux ([109.76.144.236]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4922fa3a4easm275198015e9.3.2026.06.18.05.23.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2026 05:23:04 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz Subject: [PATCH 10/30] libcamera: software_isp: gpu_pipeline_shader_pass: Move common attribute and uniform variables to base shader class Date: Thu, 18 Jun 2026 13:22:23 +0100 Message-ID: <20260618122245.946138-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260618122245.946138-1-bryan.odonoghue@linaro.org> References: <20260618122245.946138-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Every shader pass will want to set these variables so define them in the base class not in the demosiac class. Render therefore unto Cesar the things which are Cesar's. Signed-off-by: Bryan O'Donoghue --- .../software_isp/gpu_pipeline_shader_pass.h | 13 +++++++++++++ .../gpu_pipeline_shader_pass_demosiac.h | 10 ---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/libcamera/software_isp/gpu_pipeline_shader_pass.h b/src/libcamera/software_isp/gpu_pipeline_shader_pass.h index d4d4cf34d..d55b27a85 100644 --- a/src/libcamera/software_isp/gpu_pipeline_shader_pass.h +++ b/src/libcamera/software_isp/gpu_pipeline_shader_pass.h @@ -78,6 +78,19 @@ protected: struct PassConfig passInputCfg_; struct PassConfig passOutputCfg_; + + /* Common shader attributes */ + GLint attributeVertex_; + GLint attributeTexture_; + GLint textureUniformProjMatrix_; + GLint textureUniformBayerDataIn_; + GLint textureUniformStrideFactor_; + uint32_t shaderStridePixels_; + + /* Bayer shader parameters - useful to potentially more than one shader */ + GLint textureUniformBayerFirstRed_; + float firstRed_x_; + float firstRed_y_; }; } /* namespace libcamera */ diff --git a/src/libcamera/software_isp/gpu_pipeline_shader_pass_demosiac.h b/src/libcamera/software_isp/gpu_pipeline_shader_pass_demosiac.h index 11bb04c30..60f175ad3 100644 --- a/src/libcamera/software_isp/gpu_pipeline_shader_pass_demosiac.h +++ b/src/libcamera/software_isp/gpu_pipeline_shader_pass_demosiac.h @@ -43,18 +43,8 @@ public: const char *name() const override { return "GpuIspShaderPassDemosiac"; } private: /* Shader parameters */ - float firstRed_x_; - float firstRed_y_; - GLint attributeVertex_; - GLint attributeTexture_; GLint textureUniformStep_; GLint textureUniformSize_; - GLint textureUniformStrideFactor_; - GLint textureUniformBayerFirstRed_; - GLint textureUniformProjMatrix_; - GLint textureUniformBayerDataIn_; - - uint32_t shaderStridePixels_; /* Represent per-frame CCM as a uniform vector of floats 3 x 3 */ GLint ccmUniformDataIn_;