From patchwork Thu Sep 17 11:06:24 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: 53784 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 patches.linaro.org (Postfix) with ESMTPS id E837122E57 for ; Thu, 17 Sep 2015 11:06:42 +0000 (UTC) Received: by lagj9 with SMTP id j9sf5667312lag.0 for ; Thu, 17 Sep 2015 04:06:41 -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=7cITH4u6LFppfIuGnI6iFtUnwt06pRI3nVqO3hitxZ0=; b=ZjT1j23Mf0B/jYI4M8dj7x6POOm9OKP5kiGr8se9IBh+npo5asoG4N89kSKM10Uerp oCbKGjT/S0GMPzNB3j/OLuI0Tf+Os+ActUmMiwR+m3AmVU1b9cclaIU6PdxE91Dow3uM KXJVyl7e0bl2muZCCYUvrjcXptNpWM/h0/1DdYWD9vg/h/BHR/TDSqQC944f/s2OXSIi mL3NFbcPnb6OuOq4gizpG0ezccgKHYIjuwL5YYN1Zzzu09Qc/5rod3EU7q/Rdq2q2q9Y qFkLjJ9YMHaFDDNaIjTQd85jLdV/24kFNChB4EdOmSUarYiZqNXODtI6VJIhGHKC2AaV bYKw== X-Gm-Message-State: ALoCoQmzAkYDhufawXFf8IFz2HJXAiD++6MIiWGww2imyUsaDNg0pocr/b7B43QPGIvUnFr+OT9M X-Received: by 10.180.99.196 with SMTP id es4mr642619wib.1.1442488001635; Thu, 17 Sep 2015 04:06:41 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.103 with SMTP id l7ls71383laf.78.gmail; Thu, 17 Sep 2015 04:06:41 -0700 (PDT) X-Received: by 10.112.126.195 with SMTP id na3mr28473979lbb.50.1442488001496; Thu, 17 Sep 2015 04:06:41 -0700 (PDT) Received: from mail-lb0-x22c.google.com (mail-lb0-x22c.google.com. [2a00:1450:4010:c04::22c]) by mx.google.com with ESMTPS id xf5si239166lbb.93.2015.09.17.04.06.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 04:06:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22c as permitted sender) client-ip=2a00:1450:4010:c04::22c; Received: by lbcao8 with SMTP id ao8so7235269lbc.3 for ; Thu, 17 Sep 2015 04:06:41 -0700 (PDT) X-Received: by 10.152.23.199 with SMTP id o7mr33027319laf.76.1442488001332; Thu, 17 Sep 2015 04:06:41 -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.59.35 with SMTP id w3csp3000280lbq; Thu, 17 Sep 2015 04:06:40 -0700 (PDT) X-Received: by 10.107.170.32 with SMTP id t32mr4982968ioe.173.1442488000374; Thu, 17 Sep 2015 04:06:40 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id o194si1930177ioo.181.2015.09.17.04.06.40; Thu, 17 Sep 2015 04:06:40 -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 C03EC6E67E; Thu, 17 Sep 2015 04:06:39 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm4-vm4.bullet.mail.gq1.yahoo.com (nm4-vm4.bullet.mail.gq1.yahoo.com [98.136.218.163]) by gabe.freedesktop.org (Postfix) with ESMTPS id 85CBB6E67E for ; Thu, 17 Sep 2015 04:06:39 -0700 (PDT) Received: from [216.39.60.181] by nm4.bullet.mail.gq1.yahoo.com with NNFMP; 17 Sep 2015 11:06:38 -0000 Received: from [208.71.42.191] by tm17.bullet.mail.gq1.yahoo.com with NNFMP; 17 Sep 2015 11:06:38 -0000 Received: from [127.0.0.1] by smtp202.mail.gq1.yahoo.com with NNFMP; 17 Sep 2015 11:06:38 -0000 X-Yahoo-Newman-Id: 679552.89563.bm@smtp202.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: PqxGrl0VM1nvEqtIpI_X.hZdLjZFCH.8NKomGxUXvoRKyTl D0NC4_8zAD6vcT8m5GAWX7D1QXWsyQc7BSdaZJHH4csq4znI.MRN535X3eF3 YQX.2RlM5KRkrVV0S5JKwR_Bt7qT76IrzmRMyyn.i.Q9EVnRovv_Uvq38qmv e0G0ss_4KF45IOT8DIdrQjoT2VJKmSaQnSoDPrbrjYcK8Pjo6Q6NoISTu047 dYmbFeQfxbw6v.6NwKHGElgTorTDhWGvZ9EN00_UAIeaKZrDcNRiR0p_ympG _S9PxIeWpmNVUtB4wa_tP3PRaLR6lKq2cyaSrxVDioZ2U0ij4aBLCd_wl3Ju F0QqCm8lHxFM.T8rMokNK6_Lpxh2k_nSVEHwzhZSZw6ud2BW0r17O3q48z.o U0obRpjKQZ58gBT8KTs9PNxZ04xkeK5cJT1RG1vw_8Hge0Wo9HHEXeoHB7jV 6jly.cLDW.ljqkiDRPIKmNzCJNPGLZxrkmzhgKx277ed62V9GXZ3J.IGR8ui dcpSsHjdE2gVL50stDp04oDAx2ILswfXhKoM- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Thu, 17 Sep 2015 21:06:24 +1000 Message-Id: <1442487984-3230-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 Subject: [Piglit] [PATCH] arb_arrays_of_arrays: add nested struct indirect test 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::22c as permitted sender) smtp.mailfrom=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 This tests that Mesa generates the correct uniform offset for indirects for the two scenarios where a member of AoA will have an impact. 1) A member is an AoA 2) A member is an AoA of structs --- ...struct-arrays-nonconst-nested-array.shader_test | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/execution/sampler/fs-nested-struct-arrays-nonconst-nested-array.shader_test diff --git a/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-nested-struct-arrays-nonconst-nested-array.shader_test b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-nested-struct-arrays-nonconst-nested-array.shader_test new file mode 100644 index 0000000..260f1a9 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/sampler/fs-nested-struct-arrays-nonconst-nested-array.shader_test @@ -0,0 +1,100 @@ +# This test verifies that dynamic uniform indexing of samplers within +# a nested struct array for the fragment shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_arrays_of_arrays +GL_ARB_gpu_shader5 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_arrays_of_arrays: enable +#extension GL_ARB_gpu_shader5: require + +struct S_inner { + sampler2D tex; + sampler2D tex2; +}; + +struct S { + S_inner si[2][2]; + sampler2D tex[2][3]; + sampler2D final_member[2]; +}; + +uniform S s; + +uniform int n; +uniform int select; + +out vec4 color; + +void main() +{ + if (select == 0) + color = texture(s.tex[n][n], vec2(0.75, 0.25)); + else if (select == 1) + color = texture(s.si[n][n].tex, vec2(0.75, 0.25)) + texture(s.si[n][n].tex2, vec2(0.75, 0.25)); + else if (select == 2) + color = texture(s.final_member[n], vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s.final_member[0] 1 +uniform int s.tex[1][1] 2 +uniform int s.si[0][0].tex 3 +uniform int s.si[1][1].tex 4 +uniform int s.si[0][0].tex2 5 +uniform int s.si[1][1].tex2 6 + +texture checkerboard 1 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 2 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 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 0.25, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 4 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.25, 0.25, 0.25, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 5 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 0.75, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 6 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.75, 0.75, 0.75, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int select 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 select 1 +uniform int n 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 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) + +uniform int select 2 +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)