From patchwork Thu Jun 4 02:28:43 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: 49498 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B64324612 for ; Thu, 4 Jun 2015 02:29:01 +0000 (UTC) Received: by wgv5 with SMTP id 5sf6769981wgv.0 for ; Wed, 03 Jun 2015 19:29:00 -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=2qMQ01SFv8pvnrotu99ABxT6pBWi7t1IH8VSzxEYKIo=; b=mXrW71en/uaEUUge7Fw9Vb9Ug/u0/hy6JNbKO8vbbVlmpPL1Tt3x081KffFdBtUhU1 GIIddlOfShdpdcZOPEOoz7fKXKTwlMhm2ncUMCwL9cRvPvswEyFvbP8e5Ewl9JlUX8UQ GCW62cQoTwdTtMi0dBoWcx6HVOW8ACtURa699ekwolyBBITVXjwea5vCSnK8BOqAK3Fu DxVGlw6n2JBKhCjOxG4GFlCoIw0hPItFoYuSWtbvjU7BXEj6DH3Oy+1f9BeMj/SZuUdQ jsF6aV71KHs2onifElVV9EFvvrlAW6H16o+X3v3USkcYh/jm+wfgxZO5HXGbYhJwtzdn xNWw== X-Gm-Message-State: ALoCoQmOVPOL11ygz7QLpBSgXdsxK5q4/itOnCDCFBbSegKuuO+d7QBYcfyA9uq4nnZVMkq4ahav X-Received: by 10.112.13.200 with SMTP id j8mr33148475lbc.14.1433384940640; Wed, 03 Jun 2015 19:29:00 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.2.194 with SMTP id 2ls152905law.0.gmail; Wed, 03 Jun 2015 19:29:00 -0700 (PDT) X-Received: by 10.112.137.99 with SMTP id qh3mr11086869lbb.108.1433384940523; Wed, 03 Jun 2015 19:29:00 -0700 (PDT) Received: from mail-la0-x22c.google.com (mail-la0-x22c.google.com. [2a00:1450:4010:c03::22c]) by mx.google.com with ESMTPS id qs3si513276lbb.164.2015.06.03.19.29.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2015 19:29:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22c as permitted sender) client-ip=2a00:1450:4010:c03::22c; Received: by laei3 with SMTP id i3so21649119lae.3 for ; Wed, 03 Jun 2015 19:29:00 -0700 (PDT) X-Received: by 10.112.182.4 with SMTP id ea4mr30138363lbc.35.1433384940418; Wed, 03 Jun 2015 19:29:00 -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 hn6csp247029lbb; Wed, 3 Jun 2015 19:28:59 -0700 (PDT) X-Received: by 10.66.163.69 with SMTP id yg5mr63274299pab.150.1433384938579; Wed, 03 Jun 2015 19:28:58 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id mv8si3609676pdb.4.2015.06.03.19.28.57; Wed, 03 Jun 2015 19:28:58 -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 1C5566E5EF; Wed, 3 Jun 2015 19:28:57 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm10.bullet.mail.gq1.yahoo.com (nm10.bullet.mail.gq1.yahoo.com [98.136.218.39]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D45D6E5EF for ; Wed, 3 Jun 2015 19:28:55 -0700 (PDT) Received: from [216.39.60.184] by nm10.bullet.mail.gq1.yahoo.com with NNFMP; 04 Jun 2015 02:28:54 -0000 Received: from [208.71.42.190] by tm20.bullet.mail.gq1.yahoo.com with NNFMP; 04 Jun 2015 02:28:54 -0000 Received: from [127.0.0.1] by smtp201.mail.gq1.yahoo.com with NNFMP; 04 Jun 2015 02:28:54 -0000 X-Yahoo-Newman-Id: 284594.91665.bm@smtp201.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: PUaA7XsVM1k_o6filQHXhmOfaShyitxvxOIIDcu20UXfmfe J67Ukv.hPQv3X.UdcfyElR7ZP1JcnazbmELZSORhWdv93vR4IJaOE2jHN0mF rL2w.VXwYQNPxqQjJixJjSSr7HarP1NSEynw7iepr6DC1D_ovfg6O69.grEg H8AACDdlG4meReYON3otRAovAbdQ3ntUNyrtoHsUc9FedJ9wpFuOlgcWuv6o q8FA9deE5Xbt0k6LHJQoz29MfFNRfxR3VMaV3Z5T7wzIoseLs1IfNj1sHFsg UnT2v7KwbY7eln2l1idEKhMIrHkN0eP7C09wb0JBNYsZH1r05xZUBqcwjTzK mqW5vj7H3gSYe324vySl7J_ogaoBa4LH58OVoqWFAQt6kGQFEroztq22ZG7G w5fWXNQdgkYwC4lTNYaHGp2As4C6keo4kLrsl1CN4ZM61V_pZBqjR0t_JvSZ iq_EO8MWjVcITcOudBAGeertxTxEuQ4qy4kTgT7CQ3NttjMo9KujuO1_HXRp 6NPZwBqsyWLIXMJn2dSC50dWfA4yRv3oYbKM- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Thu, 4 Jun 2015 12:28:43 +1000 Message-Id: <1433384923-10715-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.1.0 Subject: [Piglit] [PATCH] arb_gpu_shader5: test indexing of samplers inside structs 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::22c 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 --- .../fs-struct-nonconst-sampler-const.shader_test | 72 ++++++++++++++++++++ ...fs-struct-nonconst-sampler-nonconst.shader_test | 77 ++++++++++++++++++++++ .../fs-struct-nonconst-sampler.shader_test | 72 ++++++++++++++++++++ 3 files changed, 221 insertions(+) create mode 100644 tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler-const.shader_test create mode 100644 tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler-nonconst.shader_test create mode 100644 tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler.shader_test diff --git a/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler-const.shader_test b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler-const.shader_test new file mode 100644 index 0000000..16f73a4 --- /dev/null +++ b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler-const.shader_test @@ -0,0 +1,72 @@ +# 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[4]; + +uniform int n; + +out vec4 color; + +void main() +{ + color = texture(s[n].tex[1], vec2(0.5, 0.5)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0].tex[1] 0 +uniform int s[1].tex[1] 1 +uniform int s[2].tex[1] 2 +uniform int s[3].tex[1] 3 + +texture checkerboard 0 0 (32, 32) (1.0, 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.0, 1.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.0, 0.0, 1.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) (1.0, 1.0, 1.0, 1.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 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 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 2 +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 3 +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_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler-nonconst.shader_test b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler-nonconst.shader_test new file mode 100644 index 0000000..88310ab --- /dev/null +++ b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler-nonconst.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]; + +uniform int n; +uniform int m; + +out vec4 color; + +void main() +{ + color = texture(s[n].tex[m], vec2(0.5, 0.5)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0].tex[0] 0 +uniform int s[0].tex[1] 1 +uniform int s[1].tex[0] 2 +uniform int s[1].tex[1] 3 + +texture checkerboard 0 0 (32, 32) (1.0, 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.0, 1.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.0, 0.0, 1.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) (1.0, 1.0, 1.0, 1.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_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler.shader_test b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler.shader_test new file mode 100644 index 0000000..9c6df15 --- /dev/null +++ b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-sampler.shader_test @@ -0,0 +1,72 @@ +# 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; +}; + +uniform S s[4]; + +uniform int n; + +out vec4 color; + +void main() +{ + color = texture(s[n].tex, vec2(0.5, 0.5)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0].tex 0 +uniform int s[1].tex 1 +uniform int s[2].tex 2 +uniform int s[3].tex 3 + +texture checkerboard 0 0 (32, 32) (1.0, 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.0, 1.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.0, 0.0, 1.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) (1.0, 1.0, 1.0, 1.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 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 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 2 +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 3 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0)