[{"id":24037,"web_url":"https://patchwork.libcamera.org/comment/24037/","msgid":"<Ytmzxyv2u1XR0mfO@pendragon.ideasonboard.com>","date":"2022-07-21T20:15:03","subject":"Re: [libcamera-devel] [PATCH v2 2/2] qcam: assets: shader:\n\tbayer_8.vert: Add precision","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kunal,\n\nThank you for the patch.\n\nOn Wed, Jun 29, 2022 at 12:43:55AM +0530, Kunal Agarwal via libcamera-devel wrote:\n> Currently there is no defined precision for data types\n> which results in compilation errors for shader.\n> \n> Adding precision mediump for sufficient and required\n> range and accuracy. Also suitable for textures.\n> Precision highp also works but is not supported by some\n> older hardware devices and consumes more memory.\n\nThe OpenGL ES Shading Language specification states, in section \"4.5.3\nDefault Precision Qualifiers\",\n\n  The vertex language has the following predeclared globally scoped\n  default precision statements:\n\n  precision highp float;\n  precision highp int;\n  precision lowp sampler2D;\n  precision lowp samplerCube;\n\nDo you get any shader compilation error without this patch ? If so, on\nwhich platform ? If not, do you need to reduce the precision for floats\nto mediump, or is the default highp fine ?\n\n> Signed-off-by: Kunal Agarwal <kunalagarwal1072002@gmail.com>\n> ---\n>  src/qcam/assets/shader/bayer_8.vert | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/src/qcam/assets/shader/bayer_8.vert b/src/qcam/assets/shader/bayer_8.vert\n> index 3695a5e9..a250bb81 100644\n> --- a/src/qcam/assets/shader/bayer_8.vert\n> +++ b/src/qcam/assets/shader/bayer_8.vert\n> @@ -15,6 +15,9 @@ Copyright (C) 2021, Linaro\n>  */\n>  \n>  //Vertex Shader\n> +#ifdef GL_ES\n> +precision mediump float;\n> +#endif\n>  \n>  attribute vec4 vertexIn;\n>  attribute vec2 textureIn;","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 CDA49BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 21 Jul 2022 20:15:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EF83E6330F;\n\tThu, 21 Jul 2022 22:15:06 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AEA53601B8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Jul 2022 22:15:05 +0200 (CEST)","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 EE109496;\n\tThu, 21 Jul 2022 22:15:04 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658434507;\n\tbh=f8GUp7ZUCM+t18rmGUVjHhUc2Nd0uxa2Xf03idKoJGs=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=2BYdGuilm5xROl8TjGGIPjiQ/ad3D6Rxtos3Qi14IujQLer5lpCdl4P3uQAXvrdtf\n\tDYOAxhcEqxYyy2PqRQnjm6dFfa2Bn7oEC6QcLAZbwVOvyUW1fdb0aBpP1xLDwtad44\n\t6YHIJ6hRCa4F+rxDM4K5Vep7ir2zDv27pYIickvbuSDeXUz6JeZIcNc6Xu6br2gEwx\n\tcVcDT4GSl7H2UVGWlg/+Us0FJZzGwkIhINx9+kvAJQ7mhH6JrP1zyUzsKPi3gAE/NJ\n\tptaACB1u+oluN2uNnGwR5bXq1R43bG8L7gigJZrKtXm/x5c8m1nThPhZjYNvkOWONq\n\tZYlrwvNsKALjA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1658434505;\n\tbh=f8GUp7ZUCM+t18rmGUVjHhUc2Nd0uxa2Xf03idKoJGs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=axeK5Sf2vSVwALkIEP/tFBfRtJDx6XnheJcgZbzygf3KLWDjmLLMDXnfefJwQvk/f\n\tMDJeuntaEaDG99skf2fppvFbqdumbYqVJOjADGwt1COpITZA85Xb1bsacMT8L0suxg\n\tk/BwmnzwPxJeAb6alm415PxjcJLifrWyGu3LEn5w="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"axeK5Sf2\"; dkim-atps=neutral","Date":"Thu, 21 Jul 2022 23:15:03 +0300","To":"Kunal Agarwal <kunalagarwal1072002@gmail.com>","Message-ID":"<Ytmzxyv2u1XR0mfO@pendragon.ideasonboard.com>","References":"<20220628191355.78408-1-kunalagarwal1072002@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220628191355.78408-1-kunalagarwal1072002@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] qcam: assets: shader:\n\tbayer_8.vert: Add precision","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24050,"web_url":"https://patchwork.libcamera.org/comment/24050/","msgid":"<CAJP1LGZ+7fUSDWPp0aDE1ZF7M7nnFwFB2-qbnCSO0Nd4tWLf1Q@mail.gmail.com>","date":"2022-07-22T07:30:21","subject":"Re: [libcamera-devel] [PATCH v2 2/2] qcam: assets: shader:\n\tbayer_8.vert: Add precision","submitter":{"id":116,"url":"https://patchwork.libcamera.org/api/people/116/","name":"Kunal Agarwal","email":"kunalagarwal1072002@gmail.com"},"content":"Hi Laurent,\n\nThank you for the pointers.\n\n> The OpenGL ES Shading Language specification states, in section \"4.5.3\n> Default Precision Qualifiers\",\n>\n>   The vertex language has the following predeclared globally scoped\n>   default precision statements:\n>\n>   precision highp float;\n>   precision highp int;\n>   precision lowp sampler2D;\n>   precision lowp samplerCube;\n>\n> Do you get any shader compilation error without this patch ? If so, on\n> which platform ? If not, do you need to reduce the precision for floats\n> to mediump, or is the default highp fine ?\n\nTested the working of vertex shader without explicitly specifying precision.\nIt works. Other than the limitations of highp for some devices, I don't see\nany particular reason to reduce the precision of floats to mediump.\nSo default highp should be fine and this patch need not be applied.\n\nRegards,\n\nKunal Agarwal\n\n\nOn Fri, Jul 22, 2022 at 1:45 AM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hi Kunal,\n>\n> Thank you for the patch.\n>\n> On Wed, Jun 29, 2022 at 12:43:55AM +0530, Kunal Agarwal via libcamera-devel wrote:\n> > Currently there is no defined precision for data types\n> > which results in compilation errors for shader.\n> >\n> > Adding precision mediump for sufficient and required\n> > range and accuracy. Also suitable for textures.\n> > Precision highp also works but is not supported by some\n> > older hardware devices and consumes more memory.\n>\n> The OpenGL ES Shading Language specification states, in section \"4.5.3\n> Default Precision Qualifiers\",\n>\n>   The vertex language has the following predeclared globally scoped\n>   default precision statements:\n>\n>   precision highp float;\n>   precision highp int;\n>   precision lowp sampler2D;\n>   precision lowp samplerCube;\n>\n> Do you get any shader compilation error without this patch ? If so, on\n> which platform ? If not, do you need to reduce the precision for floats\n> to mediump, or is the default highp fine ?\n>\n> > Signed-off-by: Kunal Agarwal <kunalagarwal1072002@gmail.com>\n> > ---\n> >  src/qcam/assets/shader/bayer_8.vert | 3 +++\n> >  1 file changed, 3 insertions(+)\n> >\n> > diff --git a/src/qcam/assets/shader/bayer_8.vert b/src/qcam/assets/shader/bayer_8.vert\n> > index 3695a5e9..a250bb81 100644\n> > --- a/src/qcam/assets/shader/bayer_8.vert\n> > +++ b/src/qcam/assets/shader/bayer_8.vert\n> > @@ -15,6 +15,9 @@ Copyright (C) 2021, Linaro\n> >  */\n> >\n> >  //Vertex Shader\n> > +#ifdef GL_ES\n> > +precision mediump float;\n> > +#endif\n> >\n> >  attribute vec4 vertexIn;\n> >  attribute vec2 textureIn;\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 A3842BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 22 Jul 2022 07:30:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 27A0A63314;\n\tFri, 22 Jul 2022 09:30:38 +0200 (CEST)","from mail-vk1-xa2d.google.com (mail-vk1-xa2d.google.com\n\t[IPv6:2607:f8b0:4864:20::a2d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CD4936330B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Jul 2022 09:30:36 +0200 (CEST)","by mail-vk1-xa2d.google.com with SMTP id o10so1725028vkl.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Jul 2022 00:30:36 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658475038;\n\tbh=ABfbgs63Ap0xZ1X5ZmAhzOSbZLE+EpX3t4hPYd/Ix/I=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=b0HtrUgnaxMMCPmomtMMYF/lOzy7IK1D7yOYUFn1TzrhLLD6JimTTK6nvEvglTo0j\n\t5t4sU9LbfmyqNko1kHwNJh7JvhaeDmrt0OatV7Ai/DMBlIPqRq0E/lTvPjmAODELLw\n\tpUJ2agduLCio6sooOjM2PdM67D7EA2sxvpk+I6HRL6Tr1cF0pWeAreEIhr6gDRGyft\n\tSILNYbXcj5vNY2Y7D9TGWRp63YktD6Um8MuJNa+KU4qcSq5ljMNA0kKCr8AEENLF2N\n\tcjcxQKYesOt2oryck4E9cMtiWCwJZ/WWO654zsoLQ0T9FMpTHvve+kZ5iOu3r1pkQW\n\tiS/UIRNfJBOQw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=6JdETX39FVauuOjXMhhS8hV03TmpX2iTeMT1CP7u060=;\n\tb=CI2vI/UW0QQFgdUW3OKVoI2ObKBQBw6nbRIIGNYLQZL50VMSbDLpPJt/GIn3Rcc3Ic\n\tGx4xvAC+ylN08NJVBSRvlEHnsjEdaHpXd6EqXpj0T1512ec93wTff6y1XHpsZ2ruX4ec\n\tsLbJPT62tTCRzkpN+0wYOrHUxDXtiPAKTdWMZkBW3lsGmLhUwNsnjwubHIegFqqQnmCG\n\taJml/eByoxnB4Jn5I8I2+8OZGTbrvhKfbtTBAaC3p9ejiXzKOdMcbpjTySFgZFnwBaqm\n\tcvmoZY3UVLfHc4S8vi4UQMyo5P8E0HmzwF9phUERJOsR+VHvzIlDo3w3hYnMmREvaEIy\n\ttMPg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"CI2vI/UW\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=6JdETX39FVauuOjXMhhS8hV03TmpX2iTeMT1CP7u060=;\n\tb=d+z7kVP6tw9O2uCr40yQnBVC9tB76anBhyYikJcNsfAVDksoj0LRfHWQIYReWi7HKe\n\tweWNKPYrDwnpvx0bfiAGq3IK4Y0VpMMxoDfsO7D3GLWgFmNvqcH80BzLIC7KCZgwYN0t\n\tIl48neyoH8/dibCts+1yRAhbcqP7B/8IEGSFt0V0mYsKaZ7JrWQYdByWepjS/+JFgr6r\n\tA1SWoXQc4U27Se8nVq+WyjDzjJmcSyfPrgdyjQOAWCue2l7V5ZPY2CdAM9Bm4HYcbyYW\n\tGQwygOXmRvn2mMddYXyIKaZNbwCuAipyYdIlB5CYIqZfrMm04gaGQEmF2nO8SpQNXPK0\n\tKt8g==","X-Gm-Message-State":"AJIora/k2BNTm/drCUfoaEh0unAQVvEceTjmCjyUAiTphhVM1DRpdr0m\n\t/f8o03CoJ3T0+JrQkFvGqY4cti03cmwDKMh28dFD8qmq","X-Google-Smtp-Source":"AGRyM1vp0Bb+OlMlrprMfXBNzh7Uj2AaZKhIDhwbRd6H8uNsqo4rd29xg51HakyAKIXHqD17cjTZg4HGW1uJ8fSb8gg=","X-Received":"by 2002:ac5:cc56:0:b0:376:9a0:3834 with SMTP id\n\tl22-20020ac5cc56000000b0037609a03834mr706582vkm.8.1658475035531;\n\tFri, 22 Jul 2022 00:30:35 -0700 (PDT)","MIME-Version":"1.0","References":"<20220628191355.78408-1-kunalagarwal1072002@gmail.com>\n\t<Ytmzxyv2u1XR0mfO@pendragon.ideasonboard.com>","In-Reply-To":"<Ytmzxyv2u1XR0mfO@pendragon.ideasonboard.com>","Date":"Fri, 22 Jul 2022 13:00:21 +0530","Message-ID":"<CAJP1LGZ+7fUSDWPp0aDE1ZF7M7nnFwFB2-qbnCSO0Nd4tWLf1Q@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] qcam: assets: shader:\n\tbayer_8.vert: Add precision","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>","From":"Kunal Agarwal via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Kunal Agarwal <kunalagarwal1072002@gmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]