From patchwork Sat Jun 20 12:14:31 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: 50125 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 08FAE21594 for ; Sat, 20 Jun 2015 12:15:12 +0000 (UTC) Received: by lagh6 with SMTP id h6sf35327079lag.0 for ; Sat, 20 Jun 2015 05:15:10 -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=j3lCzF+fnO4DkkkRWb/L7wodMB9hoPTWs/zpN3KY564=; b=WSk+ROLEgNKUdogoZdMmaEUt1m73MbJnleoHDltQ2cj/VWXVi4iltHe1+Yc8lZU3ca jFxw6UN+QkTOcTJ5iphBbJjW+nyLl6itW8YmBEqjR6LzMVoOKU9zg942CDtYc4XtrJ4f IJRp++5CzWSWfGN7IcQvWWULOQoYTK2ns+5qiTV96YxW7TViRToZApuXrBGUd4nvY3Gq NAaI5XkkIpH4Xh69/TGmHNS14QQHMpwbVDONPxqpW+FMT6sfXLC9CrFo58ACaS5Crt3B XEfVwV6AqhT3y/y1g2CPDaOP7fol5nYQ0kpPnlGYq4+5ShJgiAstPxNDl7/D+TXf43Fn 7iIw== X-Gm-Message-State: ALoCoQlmKk1JYCirtfV7Tud8hNsDsR5t6h7k58TaWpF+W1R1E5JjyTqFmxYOlpD5+t262891IvFJ X-Received: by 10.152.5.2 with SMTP id o2mr19580374lao.0.1434802510429; Sat, 20 Jun 2015 05:15:10 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.7 with SMTP id v7ls686624laa.75.gmail; Sat, 20 Jun 2015 05:15:10 -0700 (PDT) X-Received: by 10.112.171.101 with SMTP id at5mr22334521lbc.66.1434802510158; Sat, 20 Jun 2015 05:15:10 -0700 (PDT) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com. [2a00:1450:4010:c04::229]) by mx.google.com with ESMTPS id e14si11638344lbo.160.2015.06.20.05.15.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jun 2015 05:15:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) client-ip=2a00:1450:4010:c04::229; Received: by lbbqq2 with SMTP id qq2so85578501lbb.3 for ; Sat, 20 Jun 2015 05:15:09 -0700 (PDT) X-Received: by 10.152.6.69 with SMTP id y5mr21723249lay.72.1434802509656; Sat, 20 Jun 2015 05:15:09 -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 hn6csp1209447lbb; Sat, 20 Jun 2015 05:15:07 -0700 (PDT) X-Received: by 10.70.127.140 with SMTP id ng12mr41522526pdb.94.1434802506664; Sat, 20 Jun 2015 05:15:06 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id pv3si20993175pac.49.2015.06.20.05.15.05; Sat, 20 Jun 2015 05:15:06 -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 8AC7F6E702; Sat, 20 Jun 2015 05:15:05 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm26-vm1.bullet.mail.gq1.yahoo.com (nm26-vm1.bullet.mail.gq1.yahoo.com [98.136.216.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 312026E702 for ; Sat, 20 Jun 2015 05:15:04 -0700 (PDT) Received: from [98.137.12.188] by nm26.bullet.mail.gq1.yahoo.com with NNFMP; 20 Jun 2015 12:15:03 -0000 Received: from [208.71.42.199] by tm9.bullet.mail.gq1.yahoo.com with NNFMP; 20 Jun 2015 12:15:03 -0000 Received: from [127.0.0.1] by smtp210.mail.gq1.yahoo.com with NNFMP; 20 Jun 2015 12:15:03 -0000 X-Yahoo-Newman-Id: 171151.61572.bm@smtp210.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: mMlrvOIVM1nk.lCUWZe0GC8F4RyQjRVyiIvsORow4QLRAXK ngb1AzcGUNWK.UlKDtQ4bR2.N.JrFbhNBvTh7FSoL3ZdyiznFyzutmk3yaiy FYgvcfX7ea.9uapyiDmm_eZXLr3CxqHI.ZbhVdB.PiK0tXsgSes9JtP_n4QG wQwmYgUHTD.FAxh_5Y3FKCJDHpmQcKcPIRoTjUQ1Fzsjh9dK8vGnB0zQgZMy 1ktl96Ntx3WaKs2PfzEZF4A9P34HNmPPrkR4J6Z9UOEJhXen4cYZWp9p_0on RgzxtGwhAsdRCxwFmKR.YyKKYFKW.qTdMgfUQID6E38XZHL8gRC08.Hx_IgV KLFDD7oEvI2p0nMxOu0Xx.KSm13Y6tx0i3V9peCA.ggm2N8TKTQiSoDXf1R_ W52im.ufoto0KmYQsuSIn3cXajpTzAshSFtosWlo7ZRyTlrgHdYf1u6kD45E QaSDwzOtbIO4pn1qc6i18HCjEbf8fSZNxwmmbkWMWrd57QQT_viTL9WxUxnT rwqX4LbezPZ84Zxnf6PoSF4YuPGtj9w0egVw- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sat, 20 Jun 2015 22:14:31 +1000 Message-Id: <1434802475-4020-4-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1434802475-4020-1-git-send-email-t_arceri@yahoo.com.au> References: <1434802475-4020-1-git-send-email-t_arceri@yahoo.com.au> Subject: [Piglit] [PATCH 4/8] arb_arrays_of_arrays: add some sampler indexing execution tests 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:c04::229 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 sampler-precision-qualifier.frag - pass fs-const-index-three-dimensions.shader_test - pass fs-const-index.shader_test - pass fs-initializer-const-index.shader_test - fail fs-initializer-non-const-index.shader_test - fail fs-mixed-const-and-non-const-index.shader_test - pass fs-mixed-const-and-non-const-index2.shader_test - fail fs-non-const-index.shader_test - pass fs-struct-const-index-sampler-const-index.shader_test - pass fs-struct-const-index.shader_test - pass fs-struct-non-const-index-const-index.shader_test - pass fs-struct-non-const-index-sampler-non-const-index.shader_test - pass fs-struct-non-const-index.shader_test - pass vs-const-index-three-dimensions.shader_test - pass vs-const-index.shader_test - pass vs-non-const-index.shader_test - pass vs-struct-nonconst-sampler-const.shader_test - pass vs-struct-nonconst-sampler-nonconst.shader_test - pass vs-struct-nonconst.shader_test - pass V2: add vertex shader tests, add most struct tests --- .../compiler/sampler-precision-qualifier.frag | 19 +++++ .../fs-const-index-three-dimensions.shader_test | 32 ++++++++ .../execution/sampler/fs-const-index.shader_test | 32 ++++++++ .../sampler/fs-initializer-const-index.shader_test | 47 ++++++++++++ .../fs-initializer-non-const-index.shader_test | 79 +++++++++++++++++++ .../fs-mixed-const-and-non-const-index.shader_test | 60 +++++++++++++++ ...fs-mixed-const-and-non-const-index2.shader_test | 67 ++++++++++++++++ .../sampler/fs-non-const-index.shader_test | 75 ++++++++++++++++++ ...uct-const-index-sampler-const-index.shader_test | 36 +++++++++ .../sampler/fs-struct-const-index.shader_test | 34 +++++++++ ...-struct-non-const-index-const-index.shader_test | 77 +++++++++++++++++++ ...const-index-sampler-non-const-index.shader_test | 77 +++++++++++++++++++ .../sampler/fs-struct-non-const-index.shader_test | 79 +++++++++++++++++++ .../vs-const-index-three-dimensions.shader_test | 32 ++++++++ .../execution/sampler/vs-const-index.shader_test | 32 ++++++++ .../sampler/vs-non-const-index.shader_test | 85 +++++++++++++++++++++ .../vs-struct-nonconst-sampler-const.shader_test | 89 ++++++++++++++++++++++ ...vs-struct-nonconst-sampler-nonconst.shader_test | 89 ++++++++++++++++++++++ .../sampler/vs-struct-nonconst.shader_test | 89 ++++++++++++++++++++++ 19 files changed, 1130 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/sampler-precision-qualifier.frag create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-const-index-three-dimensions.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-initializer-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-initializer-non-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-mixed-const-and-non-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-mixed-const-and-non-const-index2.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-non-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-const-index-sampler-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index-sampler-non-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/vs-const-index-three-dimensions.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/vs-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/vs-non-const-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst-sampler-const.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst-sampler-nonconst.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst.shader_test diff --git a/tests/spec/arb_arrays_of_arrays/compiler/sampler-precision-qualifier.frag b/tests/spec/arb_arrays_of_arrays/compiler/sampler-precision-qualifier.frag new file mode 100644 index 0000000..687550a --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/sampler-precision-qualifier.frag @@ -0,0 +1,19 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.30 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + * + * Precision qualifiers apply to floating point, integer and sampler + * types. Test to see if and array of samplers correctly compiles. + */ +#version 130 +#extension GL_ARB_arrays_of_arrays: enable + +uniform lowp sampler2D sampler[1][1]; +in highp vec2 coord; + +void main() +{ + gl_FragColor = texture2D(sampler[0][0], coord); +} diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-const-index-three-dimensions.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-const-index-three-dimensions.shader_test new file mode 100644 index 0000000..2972fa3 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-const-index-three-dimensions.shader_test @@ -0,0 +1,32 @@ +[require] +GLSL >= 1.20 +GL_ARB_arrays_of_arrays + +[vertex shader] +#extension GL_ARB_arrays_of_arrays: enable +varying vec4 texcoords; + +void main() +{ + gl_Position = gl_Vertex; + texcoords = (gl_Vertex + 1.0) / 2.0; +} + +[fragment shader] +#extension GL_ARB_arrays_of_arrays: enable +varying vec4 texcoords; +uniform sampler2D tex[2][2][2]; + +void main() +{ + gl_FragColor = texture2D(tex[1][0][1], texcoords.xy); +} + +[test] +uniform int tex[1][0][1] 1 +texture rgbw 1 (8, 8) +draw rect -1 -1 2 2 +relative probe rgb (0.25, 0.25) (1.0, 0.0, 0.0) +relative probe rgb (0.75, 0.25) (0.0, 1.0, 0.0) +relative probe rgb (0.25, 0.75) (0.0, 0.0, 1.0) +relative probe rgb (0.75, 0.75) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-const-index.shader_test new file mode 100644 index 0000000..6043f42 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-const-index.shader_test @@ -0,0 +1,32 @@ +[require] +GLSL >= 1.20 +GL_ARB_arrays_of_arrays + +[vertex shader] +#extension GL_ARB_arrays_of_arrays: enable +varying vec4 texcoords; + +void main() +{ + gl_Position = gl_Vertex; + texcoords = (gl_Vertex + 1.0) / 2.0; +} + +[fragment shader] +#extension GL_ARB_arrays_of_arrays: enable +varying vec4 texcoords; +uniform sampler2D tex[2][2]; + +void main() +{ + gl_FragColor = texture2D(tex[1][1], texcoords.xy); +} + +[test] +uniform int tex[1][1] 1 +texture rgbw 1 (8, 8) +draw rect -1 -1 2 2 +relative probe rgb (0.25, 0.25) (1.0, 0.0, 0.0) +relative probe rgb (0.75, 0.25) (0.0, 1.0, 0.0) +relative probe rgb (0.25, 0.75) (0.0, 0.0, 1.0) +relative probe rgb (0.75, 0.75) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-initializer-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-initializer-const-index.shader_test new file mode 100644 index 0000000..9ed59dd --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-initializer-const-index.shader_test @@ -0,0 +1,47 @@ +# Normally, uniform array variables are initialized by array literals. +# +# However, samplers are different. Consider a declaration such as: +# +# layout(binding = 5) uniform sampler2D[3]; +# +# The initializer value is a single integer (5), while the storage has 3 +# array elements. The proper behavior is to increment one for each +# element; they should be initialized to 5, 6, and 7. + +[require] +GLSL >= 1.40 +GL_ARB_arrays_of_arrays +GL_ARB_shading_language_420pack + +[vertex shader] +#extension GL_ARB_arrays_of_arrays: enable +in vec4 piglit_vertex; +out vec4 texcoords; + +void main() +{ + gl_Position = piglit_vertex; + texcoords = (piglit_vertex + 1.0) / 2.0; +} + +[fragment shader] +#extension GL_ARB_arrays_of_arrays: enable +#extension GL_ARB_shading_language_420pack: enable + +layout(binding = 0) uniform sampler2D tex[2][2][2]; + +in vec4 texcoords; +out vec4 color; + +void main() +{ + color = texture2D(tex[0][1][1], texcoords.xy); +} + +[test] +texture rgbw 3 (8, 8) +draw rect -1 -1 2 2 +relative probe rgb (0.25, 0.25) (1.0, 0.0, 0.0) +relative probe rgb (0.75, 0.25) (0.0, 1.0, 0.0) +relative probe rgb (0.25, 0.75) (0.0, 0.0, 1.0) +relative probe rgb (0.75, 0.75) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-initializer-non-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-initializer-non-const-index.shader_test new file mode 100644 index 0000000..88ab686 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-initializer-non-const-index.shader_test @@ -0,0 +1,79 @@ +# Normally, uniform array variables are initialized by array literals. +# +# However, samplers are different. Consider a declaration such as: +# +# layout(binding = 5) uniform sampler2D[3]; +# +# The initializer value is a single integer (5), while the storage has 3 +# array elements. The proper behavior is to increment one for each +# element; they should be initialized to 5, 6, and 7. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 +GL_ARB_arrays_of_arrays +GL_ARB_shading_language_420pack + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_shading_language_420pack : enable +#extension GL_ARB_gpu_shader5: require +#extension GL_ARB_arrays_of_arrays: enable + +layout(binding = 0) uniform sampler2D tex[2][2]; + +uniform int n; +uniform int m; + +out vec4 color; + +void main() +{ + color = texture(tex[n][m], vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 0 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 1 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-mixed-const-and-non-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-mixed-const-and-non-const-index.shader_test new file mode 100644 index 0000000..f993e76 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-mixed-const-and-non-const-index.shader_test @@ -0,0 +1,60 @@ +# This test verifies that dynamically uniform indexing of sampler arrays +# in the fragment shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 +GL_ARB_arrays_of_arrays + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require +#extension GL_ARB_arrays_of_arrays: enable + +uniform sampler2D s[2][2]; + +uniform int n; + +out vec4 color; + +void main() +{ + color = texture(s[n][1], vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0][0] 0 +uniform int s[0][1] 1 +uniform int s[1][0] 2 +uniform int s[1][1] 3 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-mixed-const-and-non-const-index2.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-mixed-const-and-non-const-index2.shader_test new file mode 100644 index 0000000..05ce652 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-mixed-const-and-non-const-index2.shader_test @@ -0,0 +1,67 @@ +# This test verifies that dynamically uniform indexing of sampler arrays +# in the fragment shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 +GL_ARB_arrays_of_arrays + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require +#extension GL_ARB_arrays_of_arrays: enable + +uniform sampler2D s[2][2]; + +uniform int n; + +out vec4 color; + +void main() +{ + color = texture(s[1][n], vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0][0] 0 +uniform int s[0][1] 1 +uniform int s[1][0] 2 +uniform int s[1][1] 3 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +draw rect -1 0 1 1 +# real outcome? +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +#uniform int n 0 +#draw rect 0 -1 1 1 +#relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) + + + diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-non-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-non-const-index.shader_test new file mode 100644 index 0000000..9aa1f64 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-non-const-index.shader_test @@ -0,0 +1,75 @@ +# This test verifies that dynamically uniform indexing of sampler arrays +# in the fragment shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 +GL_ARB_arrays_of_arrays + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require +#extension GL_ARB_arrays_of_arrays: enable + +uniform sampler2D s[2][2]; + +uniform int n; +uniform int m; + +out vec4 color; + +void main() +{ + color = texture(s[n][m], vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0][0] 0 +uniform int s[0][1] 1 +uniform int s[1][0] 2 +uniform int s[1][1] 3 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 0 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 1 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-const-index-sampler-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-const-index-sampler-const-index.shader_test new file mode 100644 index 0000000..00c5cab --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-const-index-sampler-const-index.shader_test @@ -0,0 +1,36 @@ +[require] +GLSL >= 1.20 +GL_ARB_arrays_of_arrays + +[vertex shader] +#extension GL_ARB_arrays_of_arrays: enable +varying vec4 texcoords; + +void main() +{ + gl_Position = gl_Vertex; + texcoords = (gl_Vertex + 1.0) / 2.0; +} + +[fragment shader] +#extension GL_ARB_arrays_of_arrays: enable +varying vec4 texcoords; +struct S { + sampler2D tex[2][2]; +}; + +uniform S i[2][2]; + +void main() +{ + gl_FragColor = texture2D(i[1][1].tex[1][1], texcoords.xy); +} + +[test] +uniform int i[1][1].tex[1][1] 1 +texture rgbw 1 (8, 8) +draw rect -1 -1 2 2 +relative probe rgb (0.25, 0.25) (1.0, 0.0, 0.0) +relative probe rgb (0.75, 0.25) (0.0, 1.0, 0.0) +relative probe rgb (0.25, 0.75) (0.0, 0.0, 1.0) +relative probe rgb (0.75, 0.75) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-const-index.shader_test new file mode 100644 index 0000000..f15d13b --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-const-index.shader_test @@ -0,0 +1,34 @@ +[require] +GLSL >= 1.10 + +[vertex shader] +varying vec4 texcoords; + +void main() +{ + gl_Position = gl_Vertex; + texcoords = (gl_Vertex + 1.0) / 2.0; +} + +[fragment shader] +#extension GL_ARB_arrays_of_arrays: enable +varying vec4 texcoords; +struct S { + sampler2D tex; +}; + +uniform S i[2][2]; + +void main() +{ + gl_FragColor = texture2D(i[1][1].tex, texcoords.xy); +} + +[test] +uniform int i[1][1].tex 1 +texture rgbw 1 (8, 8) +draw rect -1 -1 2 2 +relative probe rgb (0.25, 0.25) (1.0, 0.0, 0.0) +relative probe rgb (0.75, 0.25) (0.0, 1.0, 0.0) +relative probe rgb (0.25, 0.75) (0.0, 0.0, 1.0) +relative probe rgb (0.75, 0.75) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index-const-index.shader_test new file mode 100644 index 0000000..0eeb7ee --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index-const-index.shader_test @@ -0,0 +1,77 @@ +# This test verifies that dynamically uniform indexing of sampler arrays +# in the fragment shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +struct S { + sampler2D tex[2]; +}; + +uniform S s[2][2]; + +uniform int n; +uniform int m; + +out vec4 color; + +void main() +{ + color = texture(s[n][m].tex[1], vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0][0].tex[1] 0 +uniform int s[0][1].tex[1] 1 +uniform int s[1][0].tex[1] 2 +uniform int s[1][1].tex[1] 3 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 0 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 1 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index-sampler-non-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index-sampler-non-const-index.shader_test new file mode 100644 index 0000000..d8edf65 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index-sampler-non-const-index.shader_test @@ -0,0 +1,77 @@ +# This test verifies that dynamically uniform indexing of sampler arrays +# in the fragment shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +struct S { + sampler2D tex[2]; +}; + +uniform S s[2][2]; + +uniform int n; +uniform int m; + +out vec4 color; + +void main() +{ + color = texture(s[n][1].tex[m], vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0][1].tex[0] 0 +uniform int s[0][1].tex[1] 1 +uniform int s[1][1].tex[0] 2 +uniform int s[1][1].tex[1] 3 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 0 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 1 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index.shader_test new file mode 100644 index 0000000..22ab511 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index.shader_test @@ -0,0 +1,79 @@ +# This test verifies that dynamically uniform indexing of sampler arrays +# in the fragment shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 +GL_ARB_arrays_of_arrays + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require +#extension GL_ARB_arrays_of_arrays: enable + +struct S { + sampler2D tex; +}; + +uniform S s[2][2]; + +uniform int n; +uniform int m; + +out vec4 color; + +void main() +{ + color = texture(s[n][m].tex, vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0][0].tex 0 +uniform int s[0][1].tex 1 +uniform int s[1][0].tex 2 +uniform int s[1][1].tex 3 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 0 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 1 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-const-index-three-dimensions.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-const-index-three-dimensions.shader_test new file mode 100644 index 0000000..1636605 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-const-index-three-dimensions.shader_test @@ -0,0 +1,32 @@ +[require] +GLSL >= 1.20 +GL_ARB_arrays_of_arrays + +[vertex shader] +#extension GL_ARB_arrays_of_arrays: enable +uniform sampler2D tex[2][2][2]; +varying vec4 colour; + +void main() +{ + gl_Position = gl_Vertex; + colour = texture2D(tex[1][0][1], gl_Vertex.xy); +} + +[fragment shader] +#extension GL_ARB_arrays_of_arrays: enable +varying vec4 colour; + +void main() +{ + gl_FragColor = colour; +} + +[test] +uniform int tex[1][0][1] 1 +texture rgbw 1 (8, 8) +draw rect -1 -1 2 2 +relative probe rgb (0.0, 0.0) (1.0, 0.0, 0.0) +relative probe rgb (1.0, 0.0) (0.0, 1.0, 0.0) +relative probe rgb (0.0, 1.0) (0.0, 0.0, 1.0) +relative probe rgb (1.0, 1.0) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-const-index.shader_test new file mode 100644 index 0000000..d0387d4 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-const-index.shader_test @@ -0,0 +1,32 @@ +[require] +GLSL >= 1.20 +GL_ARB_arrays_of_arrays + +[vertex shader] +#extension GL_ARB_arrays_of_arrays: enable +uniform sampler2D tex[2][2]; +varying vec4 colour; + +void main() +{ + gl_Position = gl_Vertex; + colour = texture2D(tex[1][1], gl_Vertex.xy); +} + +[fragment shader] +#extension GL_ARB_arrays_of_arrays: enable +varying vec4 colour; + +void main() +{ + gl_FragColor = colour; +} + +[test] +uniform int tex[1][1] 1 +texture rgbw 1 (8, 8) +draw rect -1 -1 2 2 +relative probe rgb (0.0, 0.0) (1.0, 0.0, 0.0) +relative probe rgb (1.0, 0.0) (0.0, 1.0, 0.0) +relative probe rgb (0.0, 1.0) (0.0, 0.0, 1.0) +relative probe rgb (1.0, 1.0) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-non-const-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-non-const-index.shader_test new file mode 100644 index 0000000..91ab4c0 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-non-const-index.shader_test @@ -0,0 +1,85 @@ +# This test verifies that dynamically uniform indexing of sampler arrays +# in the vertex shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 + +[vertex shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +uniform sampler2D s[2][2]; + +uniform int n; +uniform int m; + +in vec4 piglit_vertex; +out vec4 color; + +void main() +{ + gl_Position = piglit_vertex; + color = texture(s[n][m], vec2(0.75, 0.25)); +} + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +in vec4 color; +out vec4 out_color; + +void main() +{ + out_color = color; +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0][0] 0 +uniform int s[0][1] 1 +uniform int s[1][0] 2 +uniform int s[1][1] 3 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 0 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 1 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst-sampler-const.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst-sampler-const.shader_test new file mode 100644 index 0000000..d0b73c8 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst-sampler-const.shader_test @@ -0,0 +1,89 @@ +# This test verifies that dynamically uniform indexing of sampler arrays +# in the vertex shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 + +[vertex shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +struct S { + sampler2D tex[2]; +}; + +uniform S s[2][2]; + +uniform int n; +uniform int m; + +in vec4 piglit_vertex; +out vec4 color; + +void main() +{ + gl_Position = piglit_vertex; + color = texture(s[n][m].tex[1], vec2(0.75, 0.25)); +} + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +in vec4 color; +out vec4 out_color; + +void main() +{ + out_color = color; +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0][0].tex[1] 0 +uniform int s[0][1].tex[1] 1 +uniform int s[1][0].tex[1] 2 +uniform int s[1][1].tex[1] 3 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 0 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 1 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst-sampler-nonconst.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst-sampler-nonconst.shader_test new file mode 100644 index 0000000..a028806 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst-sampler-nonconst.shader_test @@ -0,0 +1,89 @@ +# This test verifies that dynamically uniform indexing of sampler arrays +# in the vertex shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 + +[vertex shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +struct S { + sampler2D tex[2]; +}; + +uniform S s[2][2]; + +uniform int n; +uniform int m; + +in vec4 piglit_vertex; +out vec4 color; + +void main() +{ + gl_Position = piglit_vertex; + color = texture(s[n][1].tex[m], vec2(0.75, 0.25)); +} + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +in vec4 color; +out vec4 out_color; + +void main() +{ + out_color = color; +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0][1].tex[0] 0 +uniform int s[0][1].tex[1] 1 +uniform int s[1][1].tex[0] 2 +uniform int s[1][1].tex[1] 3 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 0 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 1 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst.shader_test new file mode 100644 index 0000000..5ebc2cc --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst.shader_test @@ -0,0 +1,89 @@ +# This test verifies that dynamically uniform indexing of sampler arrays +# in the vertex shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 + +[vertex shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +struct S { + sampler2D tex; +}; + +uniform S s[2][2]; + +uniform int n; +uniform int m; + +in vec4 piglit_vertex; +out vec4 color; + +void main() +{ + gl_Position = piglit_vertex; + color = texture(s[n][m].tex, vec2(0.75, 0.25)); +} + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +in vec4 color; +out vec4 out_color; + +void main() +{ + out_color = color; +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0][0].tex 0 +uniform int s[0][1].tex 1 +uniform int s[1][0].tex 2 +uniform int s[1][1].tex 3 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 0 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 1 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0)