From patchwork Sat Jul 4 03:40:03 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: 50654 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E497214B3 for ; Sat, 4 Jul 2015 03:40:21 +0000 (UTC) Received: by widjy10 with SMTP id jy10sf37317697wid.3 for ; Fri, 03 Jul 2015 20:40:20 -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:in-reply-to:references: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=ijqr7isAOXNEJlQIOuAWhubd9exppIgGVCrZEHDFK0k=; b=OeIy+29psZi42JbvzaAYYl9Ns4kRfUd0f7NU/B8ghixQdJKo5qJWkEsWeWskrsxnDE LAMvhJ51FuVAoI/E/QeBr6eWyxbKMoDhL/SkEaA0I736BfhfiP6WCcf75aeiysXFtzmf 4o5cgSwRpmojn8JLwOOBj2LJqb00KvX2TV/OUIWfJabrBSOoHZg8ETQ2UdTr3LQW87Pl xR8ACu2HmiqVhN86C1vcgHOT7Rn/nVnEdjjyX59xK8/dyRV2Q71ZlVyNpnBisvYzaeqs d+q0aWAqTDY8I37e/Br7ncl/vjurIXka3U/RwPhrJ//0j6EHvAfPNCyjszNC+bd4YhdE 4BKQ== X-Gm-Message-State: ALoCoQlqxt8tgNMgEG6XT1bQnFG3no+7EC2uH+N9g41rpHaz9n1Srnsu196zosv1unY2rf3TgzMm X-Received: by 10.112.142.67 with SMTP id ru3mr24068811lbb.1.1435981220666; Fri, 03 Jul 2015 20:40:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.134 with SMTP id c6ls550346lag.54.gmail; Fri, 03 Jul 2015 20:40:20 -0700 (PDT) X-Received: by 10.152.4.163 with SMTP id l3mr39380817lal.35.1435981220296; Fri, 03 Jul 2015 20:40:20 -0700 (PDT) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com. [2a00:1450:4010:c03::231]) by mx.google.com with ESMTPS id qq9si8881634lbc.143.2015.07.03.20.40.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 20:40:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::231 as permitted sender) client-ip=2a00:1450:4010:c03::231; Received: by lagh6 with SMTP id h6so101851614lag.2 for ; Fri, 03 Jul 2015 20:40:20 -0700 (PDT) X-Received: by 10.152.1.40 with SMTP id 8mr39445965laj.56.1435981220077; Fri, 03 Jul 2015 20:40:20 -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 hn6csp386685lbb; Fri, 3 Jul 2015 20:40:18 -0700 (PDT) X-Received: by 10.66.193.130 with SMTP id ho2mr82275754pac.111.1435981218074; Fri, 03 Jul 2015 20:40:18 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id fc2si17270023pab.110.2015.07.03.20.40.17; Fri, 03 Jul 2015 20:40:18 -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 0CEE96E1D9; Fri, 3 Jul 2015 20:40:17 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm21-vm10.bullet.mail.gq1.yahoo.com (nm21-vm10.bullet.mail.gq1.yahoo.com [98.136.217.57]) by gabe.freedesktop.org (Postfix) with ESMTPS id 158E46E1D9 for ; Fri, 3 Jul 2015 20:40:16 -0700 (PDT) Received: from [98.137.12.58] by nm21.bullet.mail.gq1.yahoo.com with NNFMP; 04 Jul 2015 03:40:15 -0000 Received: from [98.136.164.73] by tm3.bullet.mail.gq1.yahoo.com with NNFMP; 04 Jul 2015 03:40:15 -0000 Received: from [127.0.0.1] by smtp235.mail.gq1.yahoo.com with NNFMP; 04 Jul 2015 03:40:15 -0000 X-Yahoo-Newman-Id: 567973.6000.bm@smtp235.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: sEYzN5YVM1lGb1c2pLDpYX..BoWKUY0QC9BeTk.LFRLO23B .OdjyFJBV6ysZLGGdfNXo2Yc3sQIlYOQ9tVUaj7jST25kVWnGEUKuOCzqoDX RTXIozOJ44B1Yy1c.h6JvfeUn3tGJ_z32XiuF4J7xSDwx89siEnHsxmn.MxM 5Q2kwm2A4BnugykmK7WH5nOZ_Hkel8kFc92b5KD222y8TUJNj53n8Ni2Tf20 FvgXF7HruIiQK9hv8TbDwPrR02cwUkT_U8ql9rfMyfQeMZeXOhFLStcFSROp 7afvixmknRHS.uWi38SB8nI.YNLBJ_ekLYdSlkuS7WoK5ERAc5DN2ULVSf2_ NEkX_45azHMQDZT.IuZtzvQReUi7K8lST0S6spgRJXW6AvlLDoraMst4TgVl 0WPi7.37S.OH0Wnhxb_dLom7fvlC9pjRXmBfrgQzFxX4QCh44tco45TIhaTW qClbSmLCstjjdT4B_O3RCmLGqxbDx7YB1M7nVGsuSPuGAHJ5gDyPJK.WMZmY d_IyTu82_wE2Tqogf.9XDfKWSOBY8_H2TvUg- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sat, 4 Jul 2015 13:40:03 +1000 Message-Id: <1435981203-15898-2-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1435981203-15898-1-git-send-email-t_arceri@yahoo.com.au> References: <1435981203-15898-1-git-send-email-t_arceri@yahoo.com.au> Subject: [Piglit] [PATCH 2/2] arb_arrays_of_arrays: test precision qualifier with samplers 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::231 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 --- .../compiler/precision-qualifier-sampler.frag | 74 +++++++++++++++++++++ .../compiler/precision-qualifier-sampler.vert | 75 ++++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/precision-qualifier-sampler.frag create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/precision-qualifier-sampler.vert diff --git a/tests/spec/arb_arrays_of_arrays/compiler/precision-qualifier-sampler.frag b/tests/spec/arb_arrays_of_arrays/compiler/precision-qualifier-sampler.frag new file mode 100644 index 0000000..0f5449f --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/precision-qualifier-sampler.frag @@ -0,0 +1,74 @@ +// [config] +// expect_result: pass +// glsl_version: 1.30 +// require_extensions: GL_ARB_arrays_of_arrays +// 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 +#extension GL_ARB_arrays_of_arrays: enable + +#ifdef GL_ARB_texture_cube_map_array +#extension GL_ARB_texture_cube_map_array: enable +uniform mediump samplerCubeArray cms1[2][2]; +uniform mediump samplerCubeArrayShadow cms2[2][2]; +#endif + +uniform mediump sampler1D s1[2][2]; +uniform mediump sampler2D s2[2][2]; +uniform mediump sampler3D s3[2][2]; +uniform mediump samplerCube s4[2][2]; +uniform mediump samplerCubeShadow s5[2][2]; +uniform mediump sampler1DShadow s6[2][2]; +uniform mediump sampler2DShadow s7[2][2]; +uniform mediump sampler1DArray s8[2][2]; +uniform mediump sampler2DArray s9[2][2]; +uniform mediump sampler1DArrayShadow s10[2][2]; +uniform mediump sampler2DArrayShadow s11[2][2]; +uniform mediump isampler1D s12[2][2]; +uniform mediump isampler2D s13[2][2]; +uniform mediump isampler3D s14[2][2]; +uniform mediump isamplerCube s15[2][2]; +uniform mediump isampler1DArray s16[2][2]; +uniform mediump isampler2DArray s17[2][2]; +uniform mediump usampler1D s18[2][2]; +uniform mediump usampler2D s19[2][2]; +uniform mediump usampler3D s20[2][2]; +uniform mediump usamplerCube s21[2][2]; +uniform mediump usampler1DArray s22[2][2]; +uniform mediump usampler2DArray s23[2][2]; + +void main() +{ +} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/precision-qualifier-sampler.vert b/tests/spec/arb_arrays_of_arrays/compiler/precision-qualifier-sampler.vert new file mode 100644 index 0000000..1cfb01c --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/precision-qualifier-sampler.vert @@ -0,0 +1,75 @@ +// [config] +// expect_result: pass +// glsl_version: 1.30 +// require_extensions: GL_ARB_arrays_of_arrays +// 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 +#extension GL_ARB_arrays_of_arrays: enable + +#ifdef GL_ARB_texture_cube_map_array +#extension GL_ARB_texture_cube_map_array: enable +uniform mediump samplerCubeArray cms1[2][2]; +uniform mediump samplerCubeArrayShadow cms2[2][2]; +#endif + +uniform mediump sampler1D s1[2][2]; +uniform mediump sampler2D s2[2][2]; +uniform mediump sampler3D s3[2][2]; +uniform mediump samplerCube s4[2][2]; +uniform mediump samplerCubeShadow s5[2][2]; +uniform mediump sampler1DShadow s6[2][2]; +uniform mediump sampler2DShadow s7[2][2]; +uniform mediump sampler1DArray s8[2][2]; +uniform mediump sampler2DArray s9[2][2]; +uniform mediump sampler1DArrayShadow s10[2][2]; +uniform mediump sampler2DArrayShadow s11[2][2]; +uniform mediump isampler1D s12[2][2]; +uniform mediump isampler2D s13[2][2]; +uniform mediump isampler3D s14[2][2]; +uniform mediump isamplerCube s15[2][2]; +uniform mediump isampler1DArray s16[2][2]; +uniform mediump isampler2DArray s17[2][2]; +uniform mediump usampler1D s18[2][2]; +uniform mediump usampler2D s19[2][2]; +uniform mediump usampler3D s20[2][2]; +uniform mediump usamplerCube s21[2][2]; +uniform mediump usampler1DArray s22[2][2]; +uniform mediump usampler2DArray s23[2][2]; + +void main() +{ + gl_Position = vec4(0.0); +}