From patchwork Sat Jul 4 03:40:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: 'Timothy Arceri' via Patchwork Forward X-Patchwork-Id: 50653 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D9B09214B3 for ; Sat, 4 Jul 2015 03:40:19 +0000 (UTC) Received: by laar3 with SMTP id r3sf33144115laa.1 for ; Fri, 03 Jul 2015 20:40:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:reply-to; bh=MzGtt8XrHh7yxBTHpIJrt6VQD4eo2kILKxdP2nuavJY=; b=JF/zDmGbqdn1BSEzVytBXDIPqIVUeocy7dRD2vCe0EIrRxThuOP4cbt6fnDPsU2S3+ gQ2LeUWQ3PMjmpsXZZmDo2UFcPtiXoldWzKFIs5xudmQgP4DqncC/A1I4N86HFjQvl/+ +db37dmnqqcsjcuEuN7beXf8E85cvgKLfyXicSAUkTGOKD+CD6hTp3XpZhYz0L2wTlq+ DjtQzJBieFY8xxOYUoOnQMnsgZb81eWjr1Yz3bZWdSVWbb7zTmXu4gcc45/X4TjGbrG+ 0k4zugp4+KIK+FXtKWZQ3YNNdvaKJ8T+yf9oL/SNu8Gyrpzutjpg/i5yaGJBUDNL0Zp6 fgTA== X-Gm-Message-State: ALoCoQltrsfcJlB6gOPV5PBt1AIrzywqKC7GGW0jwRxjl7uhGXo2ZvokUz0hSLzf+tfNARjZgq1G X-Received: by 10.152.27.130 with SMTP id t2mr24249153lag.2.1435981217980; Fri, 03 Jul 2015 20:40:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.40 with SMTP id kv8ls505318lac.94.gmail; Fri, 03 Jul 2015 20:40:17 -0700 (PDT) X-Received: by 10.152.204.7 with SMTP id ku7mr38560348lac.38.1435981217737; Fri, 03 Jul 2015 20:40:17 -0700 (PDT) Received: from mail-la0-x230.google.com (mail-la0-x230.google.com. [2a00:1450:4010:c03::230]) by mx.google.com with ESMTPS id n4si8904258lbc.63.2015.07.03.20.40.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 20:40:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::230 as permitted sender) client-ip=2a00:1450:4010:c03::230; Received: by lagc2 with SMTP id c2so101958310lag.3 for ; Fri, 03 Jul 2015 20:40:17 -0700 (PDT) X-Received: by 10.112.220.7 with SMTP id ps7mr15103594lbc.72.1435981217525; Fri, 03 Jul 2015 20:40:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp386671lbb; Fri, 3 Jul 2015 20:40:16 -0700 (PDT) X-Received: by 10.66.66.166 with SMTP id g6mr84154084pat.157.1435981215310; Fri, 03 Jul 2015 20:40:15 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id z2si17292210pdj.39.2015.07.03.20.40.14; Fri, 03 Jul 2015 20:40:15 -0700 (PDT) Received-SPF: pass (google.com: domain of piglit-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F29706E23D; Fri, 3 Jul 2015 20:40:13 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm30-vm6.bullet.mail.gq1.yahoo.com (nm30-vm6.bullet.mail.gq1.yahoo.com [98.136.216.197]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E54B6E1DD for ; Fri, 3 Jul 2015 20:40:13 -0700 (PDT) Received: from [98.137.12.55] by nm30.bullet.mail.gq1.yahoo.com with NNFMP; 04 Jul 2015 03:40:12 -0000 Received: from [98.136.164.73] by tm15.bullet.mail.gq1.yahoo.com with NNFMP; 04 Jul 2015 03:40:12 -0000 Received: from [127.0.0.1] by smtp235.mail.gq1.yahoo.com with NNFMP; 04 Jul 2015 03:40:12 -0000 X-Yahoo-Newman-Id: 890772.6000.bm@smtp235.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: RBu1wRkVM1mkX0rTVVxcmeuH3HN0_462yZ1vd2Lj5BuhtkK pg5NlCqsJ62AGH0TY1JQjKm_d1ZAgruMyEcAmqQF11LTxBM0R26weA9jHOXH EXfqV.PhksdinsO6FxGlQSDFh3mUoXS8X6dE8lxb0q1bBH0QSHnPGvi7CNF2 oz1R51p5OzAc1NZW0.ax3rgPO2.yAmQQCy9LlqHGLMoTJ51Hs8zQOn2RgmM6 eABwPEAemXLBZqcbf7MxI_.9a1vfW4iTULZqC0DusPyP58ZyFZicnouw6D3c 5_C6Lg5Co_BfrME8vH00Ua7YrQaUeaS4upeQvzxsjnefsnZwX0kwGbcGwMb8 md215ZwuZI0LiqPMNL0kbQIE5FVjW9rWlkZ2XZXQFLdzDV8Hneryhgw4uvPc x1CnLv_GnFTsG0vVO99jgiUZoi5jChxihv0Zt2EhER9UWdNyP5.reo9DwxMS zc5vWjjfDeB42Q1kDicWoysCoVEi1g40H30S_Y8s9QVknQLBVC4g2ZAWhfzW 8sRZmOGPmbRf_lH7xiMtxL7ONfPdL1efdiA8- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sat, 4 Jul 2015 13:40:02 +1000 Message-Id: <1435981203-15898-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 Subject: [Piglit] [PATCH V2 1/2] glsl-1.30: test precision qualifier with sampler array X-BeenThere: piglit@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: piglit-bounces@lists.freedesktop.org Sender: "Piglit" X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::230 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@yahoo.com.au; dmarc=fail (p=NONE dis=NONE) header.from=yahoo.com.au Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 X-Original-From: Timothy Arceri Reply-To: Timothy Arceri V2: Add ifdef to test cube map array samplers Test results: Nvidia GeForce 840M - NVIDIA 346.47: pass --- .../precision-sampler-array.frag | 72 +++++++++++++++++++++ .../precision-sampler-array.vert | 73 ++++++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 tests/spec/glsl-1.30/compiler/precision-qualifiers/precision-sampler-array.frag create mode 100644 tests/spec/glsl-1.30/compiler/precision-qualifiers/precision-sampler-array.vert diff --git a/tests/spec/glsl-1.30/compiler/precision-qualifiers/precision-sampler-array.frag b/tests/spec/glsl-1.30/compiler/precision-qualifiers/precision-sampler-array.frag new file mode 100644 index 0000000..b528e71 --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/precision-qualifiers/precision-sampler-array.frag @@ -0,0 +1,72 @@ +// [config] +// expect_result: pass +// glsl_version: 1.30 +// check_link: true +// [end config] +// +// From the GLSL ES 3.00 specification, section 4.5.4 ("Default +// Precision Qualifiers"): +// +// "The precision statement +// +// precision precision-qualifier type; +// +// can be used to establish a default precision qualifier. The +// type field can be int or float or any of the sampler types, and +// the precision-qualifier can be lowp, mediump, or highp." +// +// Section 8 (Built-In Functions) of the GLSL ES 1.00 spec says: + +// "uniform lowp sampler2D sampler; +// highp vec2 coord; +// ... +// lowp vec4 col = texture2D (sampler, coord); +// // texture2D returns lowp" +// +// Section 4.5 (Precision and Precision Qualifiers) of the GLSL 1.30 +// spec also says: +// +// "Precision qualifiers are added for code portability with OpenGL +// ES, not for functionality. They have the same syntax as in OpenGL ES." +// +// From this, we infer that GLSL 1.30 (and later) should allow precision +// qualifiers on sampler types just like float and integer types. +// +// This test verifies that a precision qualifier can be used on all of +// GLSL 1.30's sampler types. + +#version 130 + +#ifdef GL_ARB_texture_cube_map_array +#extension GL_ARB_texture_cube_map_array: enable +uniform mediump samplerCubeArray cms1[2]; +uniform mediump samplerCubeArrayShadow cms2[2]; +#endif + +uniform mediump sampler1D s1[2]; +uniform mediump sampler2D s2[2]; +uniform mediump sampler3D s3[2]; +uniform mediump samplerCube s4[2]; +uniform mediump samplerCubeShadow s5[2]; +uniform mediump sampler1DShadow s6[2]; +uniform mediump sampler2DShadow s7[2]; +uniform mediump sampler1DArray s8[2]; +uniform mediump sampler2DArray s9[2]; +uniform mediump sampler1DArrayShadow s10[2]; +uniform mediump sampler2DArrayShadow s11[2]; +uniform mediump isampler1D s12[2]; +uniform mediump isampler2D s13[2]; +uniform mediump isampler3D s14[2]; +uniform mediump isamplerCube s15[2]; +uniform mediump isampler1DArray s16[2]; +uniform mediump isampler2DArray s17[2]; +uniform mediump usampler1D s18[2]; +uniform mediump usampler2D s19[2]; +uniform mediump usampler3D s20[2]; +uniform mediump usamplerCube s21[2]; +uniform mediump usampler1DArray s22[2]; +uniform mediump usampler2DArray s23[2]; + +void main() +{ +} diff --git a/tests/spec/glsl-1.30/compiler/precision-qualifiers/precision-sampler-array.vert b/tests/spec/glsl-1.30/compiler/precision-qualifiers/precision-sampler-array.vert new file mode 100644 index 0000000..eefc7cb --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/precision-qualifiers/precision-sampler-array.vert @@ -0,0 +1,73 @@ +// [config] +// expect_result: pass +// glsl_version: 1.30 +// check_link: true +// [end config] +// +// From the GLSL ES 3.00 specification, section 4.5.4 ("Default +// Precision Qualifiers"): +// +// "The precision statement +// +// precision precision-qualifier type; +// +// can be used to establish a default precision qualifier. The +// type field can be int or float or any of the sampler types, and +// the precision-qualifier can be lowp, mediump, or highp." +// +// Section 8 (Built-In Functions) of the GLSL ES 1.00 spec says: + +// "uniform lowp sampler2D sampler; +// highp vec2 coord; +// ... +// lowp vec4 col = texture2D (sampler, coord); +// // texture2D returns lowp" +// +// Section 4.5 (Precision and Precision Qualifiers) of the GLSL 1.30 +// spec also says: +// +// "Precision qualifiers are added for code portability with OpenGL +// ES, not for functionality. They have the same syntax as in OpenGL ES." +// +// From this, we infer that GLSL 1.30 (and later) should allow precision +// qualifiers on sampler types just like float and integer types. +// +// This test verifies that a precision qualifier can be used on all of +// GLSL 1.30's sampler types. + +#version 130 + +#ifdef GL_ARB_texture_cube_map_array +#extension GL_ARB_texture_cube_map_array: enable +uniform mediump samplerCubeArray cms1[2]; +uniform mediump samplerCubeArrayShadow cms2[2]; +#endif + +uniform mediump sampler1D s1[2]; +uniform mediump sampler2D s2[2]; +uniform mediump sampler3D s3[2]; +uniform mediump samplerCube s4[2]; +uniform mediump samplerCubeShadow s5[2]; +uniform mediump sampler1DShadow s6[2]; +uniform mediump sampler2DShadow s7[2]; +uniform mediump sampler1DArray s8[2]; +uniform mediump sampler2DArray s9[2]; +uniform mediump sampler1DArrayShadow s10[2]; +uniform mediump sampler2DArrayShadow s11[2]; +uniform mediump isampler1D s12[2]; +uniform mediump isampler2D s13[2]; +uniform mediump isampler3D s14[2]; +uniform mediump isamplerCube s15[2]; +uniform mediump isampler1DArray s16[2]; +uniform mediump isampler2DArray s17[2]; +uniform mediump usampler1D s18[2]; +uniform mediump usampler2D s19[2]; +uniform mediump usampler3D s20[2]; +uniform mediump usamplerCube s21[2]; +uniform mediump usampler1DArray s22[2]; +uniform mediump usampler2DArray s23[2]; + +void main() +{ + gl_Position = vec4(0.0); +}