From patchwork Sat Jul 4 02:15:57 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: 50648 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1AC72214B3 for ; Sat, 4 Jul 2015 02:16:20 +0000 (UTC) Received: by lagx9 with SMTP id x9sf32730133lag.2 for ; Fri, 03 Jul 2015 19:16:17 -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=ezC+/pnD0Uun8BufARA4+9sUQdu2XF6kIX9LDREW4O8=; b=GcCMNBzqCu9lzWniE7F5RCoobPyGbQ8XXn2mjDROGxF4Pith4QCqXt+wxHgd2jFGsw 8tNIWVIqJYkImj1KvE7xgQ6Wc69MGkFcMouzhd5JkS4F+0uf26KhsghkWm/JyZj8uOaE HfYVroJrGgVjxnH+4NOYgZr46ZxnvfEGjisAYUHGLSsq45MGQ7aZbeQdlS49XCJVqD/q 8zauK6aH0v+lmyiwE4MY2nYOMAjZ/Q4TKkmo74/ffC8Di7AvQJ7tFBEJUPh5cGtliNUE kLt3mEJO72pqbGjMUXcsvVgP2qig7nAvf20jhf2LE6pi5JUzoPbser81GU0mwAecRFQY WOdg== X-Gm-Message-State: ALoCoQlMjJb+EbWG3vlQQ/YlSnNas/vqANUzB3UN57kFXFhyAq78lPMTVBRIL0OLxmX1M4g16tfV X-Received: by 10.180.89.231 with SMTP id br7mr8878150wib.0.1435976177883; Fri, 03 Jul 2015 19:16:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.6 with SMTP id o6ls496598lah.56.gmail; Fri, 03 Jul 2015 19:16:17 -0700 (PDT) X-Received: by 10.112.213.108 with SMTP id nr12mr38598224lbc.42.1435976177591; Fri, 03 Jul 2015 19:16:17 -0700 (PDT) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com. [2a00:1450:4010:c03::233]) by mx.google.com with ESMTPS id rw9si5883083lbb.132.2015.07.03.19.16.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 19:16:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::233 as permitted sender) client-ip=2a00:1450:4010:c03::233; Received: by lagc2 with SMTP id c2so100983815lag.3 for ; Fri, 03 Jul 2015 19:16:17 -0700 (PDT) X-Received: by 10.112.126.101 with SMTP id mx5mr39163579lbb.35.1435976176758; Fri, 03 Jul 2015 19:16:16 -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 hn6csp359618lbb; Fri, 3 Jul 2015 19:16:15 -0700 (PDT) X-Received: by 10.68.226.166 with SMTP id rt6mr49504198pbc.2.1435976174362; Fri, 03 Jul 2015 19:16:14 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id hn9si16979000pdb.133.2015.07.03.19.16.13; Fri, 03 Jul 2015 19:16:14 -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 17B2D6E1E8; Fri, 3 Jul 2015 19:16:13 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm8-vm3.bullet.mail.gq1.yahoo.com (nm8-vm3.bullet.mail.gq1.yahoo.com [98.136.218.226]) by gabe.freedesktop.org (Postfix) with ESMTPS id D46076E1E8 for ; Fri, 3 Jul 2015 19:16:11 -0700 (PDT) Received: from [216.39.60.182] by nm8.bullet.mail.gq1.yahoo.com with NNFMP; 04 Jul 2015 02:16:11 -0000 Received: from [208.71.42.209] by tm18.bullet.mail.gq1.yahoo.com with NNFMP; 04 Jul 2015 02:16:11 -0000 Received: from [127.0.0.1] by smtp220.mail.gq1.yahoo.com with NNFMP; 04 Jul 2015 02:16:11 -0000 X-Yahoo-Newman-Id: 38002.36541.bm@smtp220.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Mlr4wt8VM1kQgaZldfnX50GMqqATXyJGc.EkJgH8Zjoymq1 IUxN4dfoMF46HtfPyUkq.URCubEe2xDPR8vQNfejIcARlnkBIui.noXrXp6A TbMGlCP9U1ONQunj3F09jeFTjiQZ28PKIHcXyNnZknE0QJAMQyP9g9khK7I6 A7BoNm8kJREn1lEWW8GoDy1YU8qaDuPwnVn1zsvc2XJ6knbvWGr7cE9A7JTi p2fZUArbx1y2VU0lhxNNTmMhKim9qINPVpXCFVAxj.2BSMioW3Ai5llgS4W2 ngGCX71r6kLrTp118ZX7JfENjvxsLU._q_Zfcwq0zVx24uX3d.q0sc2vmMNY sS8.ea4CdXOY4cMZr30CmTvLNIY8T7oFq6DCPthMYyFFr8J9cl9TxWR6g91Q SV9J_zOmZBQ6fWbIvv_FeHauUonZ6IPLuhH5GQL9dwi5LeXidT.y32IFI3KS dDpul2JI0Ss7oVw9EhJ7FAId0f0997mKcRLJDTHn7oN6HvXi.09UTwFkzd.C eUsETJGyNj3CjfD.pVPUVzH2MFdrwKxMbWW8- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sat, 4 Jul 2015 12:15:57 +1000 Message-Id: <1435976158-30728-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 Subject: [Piglit] [PATCH 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::233 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 Test results: Nvidia GeForce 840M - NVIDIA 346.47: pass --- .../precision-sampler-array.frag | 66 +++++++++++++++++++++ .../precision-sampler-array.vert | 67 ++++++++++++++++++++++ 2 files changed, 133 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..9f8ed32 --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/precision-qualifiers/precision-sampler-array.frag @@ -0,0 +1,66 @@ +// [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 + +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..7f27f29 --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/precision-qualifiers/precision-sampler-array.vert @@ -0,0 +1,67 @@ +// [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 + +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); +}