Patch Detail
Show a patch.
GET /api/patches/24214/?format=api
{ "id": 24214, "url": "https://patchwork.libcamera.org/api/patches/24214/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24214/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20250824-b4-v0-5-2-gpuisp-v2-a-v2-33-96f4576c814e@linaro.org>", "date": "2025-08-24T00:48:45", "name": "[v2,33/37] libcamera: shaders: Fix neighbouring positions in 8-bit debayering", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "9c4530f7512890919a570c4ec4f2a98ce20b4b18", "submitter": { "id": 175, "url": "https://patchwork.libcamera.org/api/people/175/?format=api", "name": "Bryan O'Donoghue", "email": "bryan.odonoghue@linaro.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24214/mbox/", "series": [ { "id": 5400, "url": "https://patchwork.libcamera.org/api/series/5400/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5400", "date": "2025-08-24T00:48:12", "name": "Add GLES 2.0 GPUISP to libcamera", "version": 2, "mbox": "https://patchwork.libcamera.org/series/5400/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/24214/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24214/checks/", "tags": {}, "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 DB276C32BB\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 24 Aug 2025 00:49:41 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3792769318;\n\tSun, 24 Aug 2025 02:49:41 +0200 (CEST)", "from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A7086931D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 24 Aug 2025 02:49:07 +0200 (CEST)", "by mail-wm1-x329.google.com with SMTP id\n\t5b1f17b1804b1-45b4d892175so15072415e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 23 Aug 2025 17:49:07 -0700 (PDT)", "from [192.168.0.13] (188-141-3-146.dynamic.upc.ie. [188.141.3.146])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-45b4e1d530esm69347225e9.0.2025.08.23.17.49.05\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 23 Aug 2025 17:49:05 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"aTwkWI30\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1755996546; x=1756601346;\n\tdarn=lists.libcamera.org; \n\th=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n\t:mime-version:subject:date:from:from:to:cc:subject:date:message-id\n\t:reply-to; bh=xjd+e35XGRyCcjAf/q+jMn0VY9rYr8yYKkhDmX1kIWI=;\n\tb=aTwkWI30aCeJHo14fSgSq7COAA0Qz4WBRTj45p4uIu/hcyf2YbhcUyat8kmFUdXWrY\n\tEJUMeu0yPeltf43DcjkpOzdz87UOnGCC3ftz1UTTYEEz0sJbv+ml4eHT2dzgjMpYgk2s\n\t3p9cJ4rda0ipQ/tbAwLmXDQkWNCYrmYWQlvUSlTmPr5JldUxFfqtOvHvBHPw747fFGzd\n\tYon0ZjpajUJutzlaF9Xccf3i1y12QcMwmM3t9A+1ZcjdYLgbw60bdMnbScwTR+nbpLbk\n\tzJ1BI8nwwHuZQj/AeYdTiM4ZfWX5qh2r/rnXZ5+ebAQGqJXBbLmTk0yhaVPwGtOT5pee\n\tnDhQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1755996546; x=1756601346;\n\th=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n\t:mime-version:subject:date:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=xjd+e35XGRyCcjAf/q+jMn0VY9rYr8yYKkhDmX1kIWI=;\n\tb=gJ3qcuIRCEYmE2Fh07jZdg9QgLvwLxds9TGaztlL7aeF73auAvXUybJAll5rOazNPG\n\tkQefAbmMie9/6dnKyQRFAUxtDAhP7bvcu57ieDqozHDP1AhH/pq/MKKBtXkvg4o+apwM\n\tE7apwpnYDrqSDNX62ZkvOy/LeRuKxwxr1MFpp94RpBKiS5aTfSURHeChKen8XRoPZtEO\n\tMfOFs3DL68RVq7zAJQQ57VAVE7LxdJSLYdWoQVGfrHzaXk/JHBzx5pAjsi++V+58PUTe\n\tfYYeAnOd8EJRGPcuvoyLwOVxBJ3RDWNwr6ll4Ak68twflqr/ZC2v06sPPGudqSxvn7fl\n\t6xZg==", "X-Gm-Message-State": "AOJu0YxJhrbr21Up+uysNT1mRdXHty1xyoIddU4JsTYOrkr5N7pJ+twE\n\ttGLkZ+pBHh6Jv1YHihPopqYFTvcSMrsVpCf+KngPm3s/3OMpXLe6mylaBkWvSC+0Ypk=", "X-Gm-Gg": "ASbGncuZ/3LdRaxqwgywcH2JIxikPjan8/KGlM+TtBiDnb5D6UqebCZf2D182P51Sav\n\tOwlZ0HapPhb07J+qNMaIy5RFzSlTlwRsBrSN1mywGBrWUPeAv6cEA6hbIfE4kQIJrMjzVMugbKN\n\tr14mR1dgn3rT2MOkDjDwqDcD6ti4cJFOTPdAht4BaJclS4TVZ/gLreo9fAfxTCcygI5n7s89sEF\n\tymhbJ+8B5kMr+UOypZQYii3xAiYSfD5I+2uM+eUOrtZPBwykzjXiML7sfRJYhB0TEVmsTlDjdA9\n\tKbt4FMn/Hr37LdH5yJ4d0AMk31b1azPp/DaGfiNJLszPYwPcKwWrGr6Nh/RxL22NPP52zGdtawM\n\tNI5SzdiO3K0KIwOx4GT15PwBc0wpdyh6rCjaX3/5UojBCWroSmGov2mG7tZz3BJ4I4ztYSgYV1/\n\tiDbTUO6+OSi3EOMnaCEYQg", "X-Google-Smtp-Source": "AGHT+IF74a8LNFkLt9QfyfMNBZ0VTJJkh3a/dfbAznwGUu6ZpN2eeEXukBDCIo5rNC4Hz9huXbeXtA==", "X-Received": "by 2002:a05:600c:1c87:b0:456:173c:8a53 with SMTP id\n\t5b1f17b1804b1-45b5179cdd5mr53665335e9.2.1755996546348; \n\tSat, 23 Aug 2025 17:49:06 -0700 (PDT)", "From": "Bryan O'Donoghue <bryan.odonoghue@linaro.org>", "Date": "Sun, 24 Aug 2025 01:48:45 +0100", "Subject": "[PATCH v2 33/37] libcamera: shaders: Fix neighbouring positions in\n\t8-bit debayering", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Message-Id": "<20250824-b4-v0-5-2-gpuisp-v2-a-v2-33-96f4576c814e@linaro.org>", "References": "<20250824-b4-v0-5-2-gpuisp-v2-a-v2-0-96f4576c814e@linaro.org>", "In-Reply-To": "<20250824-b4-v0-5-2-gpuisp-v2-a-v2-0-96f4576c814e@linaro.org>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Bryan O'Donoghue <bryan.odonoghue@linaro.org>, \n\tMilan Zamazal <mzamazal@redhat.com>", "X-Mailer": "b4 0.14.2", "X-Developer-Signature": "v=1; a=openpgp-sha256; l=1932;\n\ti=bryan.odonoghue@linaro.org; h=from:subject:message-id;\n\tbh=jkyIf6VT15/NL0QWBEUviS0cZy+665gBkjAmjr6MTjI=;\n\tb=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBoqmFi8cBG3nEuUupIUu5IL1GsAfs/SH3QzGPT8\n\txiH/ibit4yJAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCaKphYgAKCRAicTuzoY3I\n\tOjUqD/oCRUts1rWJPnUKeD4TCldVu/w47UAwrboXEAV4NMCiPhyCOoydKo9CfctqWrPVEKCRUau\n\t8XH1YVkepKgsU3fy6GJR6V5ozcngceIYOiuoxPnAcM9n24wQhNQpESK5W7MstxjEBv4tPR4fEnr\n\tXa0B/gXPf60u+2bgb0AWs4cgxl6wn41wp1aHHuXY7fLYanNBkhpujD3jCuOakVbI7rm3FdNtxrb\n\t9LDhlY6dw1MTQQzhV5KqbaobX2LL99GMDx3UW8TBfyAZvWAg26OInkVvZVE5lTLmvNAlxFO0nZi\n\tlYVmodanJxGvqIBstWTYyjWvNHNlIcDRokzEhY382EQGcwlMkeksPI32YiHG20XhV4P4Xygf3hb\n\t/LvkH2cYGu5HdttaxQTbFapJM7XnpiYVXaUvOWkBP4sCl2x34R/spzQ56tIIjAmWJRyGtXQsjV3\n\t8UaNCHiWAj5YFBU7IGXNP2+wMeXD0lGICZ+dlQBKjf4KfgIbBsPYwCKriOXMjc6IzshqunWjs3Q\n\tOtG9D6WUsDwX5D/wnndupIe9w27Wq0QvdNy23kzxLWiD/2THjiIIyJ0E02+wN8CKwzRJrKL7r1x\n\tMU9m/WoI5HqTrqd5RlEasGCglpbqgqCXHQZ4nps8eCwuPZj314ZbsivqXfIii8faA7RQN2d4ka7\n\tq5dkIRQEXutcl9Q==", "X-Developer-Key": "i=bryan.odonoghue@linaro.org; a=openpgp;\n\tfpr=E693FB2AABA36DE117AB6FB422713BB3A18DC83A", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "From: Milan Zamazal <mzamazal@redhat.com>\n\nWhen accessing a texture position in a shader, the pixel with the\nnearest centre to the specified texture coordinates (as mandated by\nspecifying GL_NEAREST parameter) is taken. The current vertex shader\ndetermines the positions of the neighbouring pixels by adding the\nprovided texture steps to the exact centre pixel coordinates. But this\nplaces the computed coordinates, from the point of view of GL_NEAREST,\nexactly between the pixels and is thus prone to floating point\ninaccuracies. Wrong neighbouring pixel coordinates may be used,\nresulting in artefacts in the output image.\n\nLet's fix the problem by shifting the initial coordinates a bit from the\npixel border.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\nSigned-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n---\n include/libcamera/internal/shaders/bayer_8.vert | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)", "diff": "diff --git a/include/libcamera/internal/shaders/bayer_8.vert b/include/libcamera/internal/shaders/bayer_8.vert\nindex fb5109eee3f556e4f4e4e444899eff8d922be573..fc1cf89f2d98acf8ebc4501cadad194fd07985bd 100644\n--- a/include/libcamera/internal/shaders/bayer_8.vert\n+++ b/include/libcamera/internal/shaders/bayer_8.vert\n@@ -44,10 +44,10 @@ void main(void) {\n center.xy = textureIn;\n center.zw = textureIn * tex_size + tex_bayer_first_red;\n \n- xCoord = center.x + vec4(-2.0 * tex_step.x,\n- -tex_step.x, tex_step.x, 2.0 * tex_step.x);\n- yCoord = center.y + vec4(-2.0 * tex_step.y,\n- -tex_step.y, tex_step.y, 2.0 * tex_step.y);\n+ xCoord = center.x + 0.1 * tex_step.x +\n+ vec4(-2.0 * tex_step.x, -tex_step.x, tex_step.x, 2.0 * tex_step.x);\n+ yCoord = center.y + 0.1 * tex_step.y +\n+ vec4(-2.0 * tex_step.y, -tex_step.y, tex_step.y, 2.0 * tex_step.y);\n \n gl_Position = proj_matrix * vertexIn;\n }\n", "prefixes": [ "v2", "33/37" ] }