From patchwork Wed Aug 5 00:36:40 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: 51940 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 patches.linaro.org (Postfix) with ESMTPS id 37E7D22E8E for ; Wed, 5 Aug 2015 00:36:59 +0000 (UTC) Received: by labop5 with SMTP id op5sf414002lab.1 for ; Tue, 04 Aug 2015 17:36:57 -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=8HhXw0ocNL5nwIAMa0Clr7++56hLJhefJNyFW1EOL04=; b=EwnBYPCcjZp7dITLLjuN1fOvv7Sja8Ffq/glEGslAbFym2UYr6nKHuiGAwKAxl+PHT nAnrGj0H+K5W1LJCOCugs//j1gg6YfNY3aPjoKLsd09OXz4Z0Rk1DJ+xC2BTeb1LvAb2 37nLTWsuy2naOEB7GKFbXjjj8OO/Z3QCdewIVAErvbTqpoDU8Xk2dKIMRgO0ApH2Krsk +QYTWRjCNnwy0wt9J5FjQ+SWtbR95+Ej3I6oW+COinRHJ1NZnqqT0MwnGMbHGdbJTLV9 30LnWrCF9HLKD6sqiMQhLItAkk24ciZotF44N3mc+iMOblClHB5bp7xZvJal3Vune/KS lUKg== X-Gm-Message-State: ALoCoQmgN/8PBHki0beED/XmvrSKy87taleLshVP6ToFGCCvsAD7ykNHpsmJGEF7aRnttQv6RUji X-Received: by 10.152.88.111 with SMTP id bf15mr1878392lab.9.1438735017892; Tue, 04 Aug 2015 17:36:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.164 with SMTP id cz4ls124562lac.3.gmail; Tue, 04 Aug 2015 17:36:57 -0700 (PDT) X-Received: by 10.152.205.1 with SMTP id lc1mr6857283lac.75.1438735017734; Tue, 04 Aug 2015 17:36:57 -0700 (PDT) Received: from mail-la0-x22a.google.com (mail-la0-x22a.google.com. [2a00:1450:4010:c03::22a]) by mx.google.com with ESMTPS id lm12si1034560lac.61.2015.08.04.17.36.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 17:36:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22a as permitted sender) client-ip=2a00:1450:4010:c03::22a; Received: by labsr2 with SMTP id sr2so18262018lab.2 for ; Tue, 04 Aug 2015 17:36:57 -0700 (PDT) X-Received: by 10.152.9.66 with SMTP id x2mr6398147laa.76.1438735017305; Tue, 04 Aug 2015 17:36:57 -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.7.198 with SMTP id l6csp69193lba; Tue, 4 Aug 2015 17:36:55 -0700 (PDT) X-Received: by 10.70.130.199 with SMTP id og7mr13417996pdb.161.1438735015095; Tue, 04 Aug 2015 17:36:55 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id fk8si1981805pdb.228.2015.08.04.17.36.54; Tue, 04 Aug 2015 17:36:55 -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 DD3026E750; Tue, 4 Aug 2015 17:36:53 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm22-vm9.bullet.mail.gq1.yahoo.com (nm22-vm9.bullet.mail.gq1.yahoo.com [98.136.217.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id 83E006E750 for ; Tue, 4 Aug 2015 17:36:52 -0700 (PDT) Received: from [216.39.60.184] by nm22.bullet.mail.gq1.yahoo.com with NNFMP; 05 Aug 2015 00:36:51 -0000 Received: from [98.136.164.65] by tm20.bullet.mail.gq1.yahoo.com with NNFMP; 05 Aug 2015 00:36:51 -0000 Received: from [127.0.0.1] by smtp227.mail.gq1.yahoo.com with NNFMP; 05 Aug 2015 00:36:51 -0000 X-Yahoo-Newman-Id: 680478.84524.bm@smtp227.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: a0GeuXMVM1lVN6NXQP6Z_40n7zSTYjZBiWh7_M8mOW3hy_M _34pejW002AGN1FIc4RGsRTez9vZeXMr3ZTrwWBQa7H1d1atApKChbhh4fNU zEKfX838EGEr5CKZAW9UDbuTv8YWUvi725MvS_SPYbfn_qK1kou.k0.c.Qzo U6jA8oP4eWUtkmRKcPTSWMxo9nRfzxzyk88v4yKf5Ys5CD0_eQGpnLp_YzGV EJM3JD7LqJS8tJgUqQ8YCFOVRijjmCDlvpPNb2ww1he4.8cJBWFiMZJRyoSu PIUQgmRrtrs_Iu.YeIxCUMtlyJ_TSXKzWiM4tGm_OwrMnHavUKpkvxQaeJVZ BOBxi0nrUAzJBGiHT_lQZ6JM02VWNVeTEBmAH92ZDZAcGjzv9CMGHSDH7QUt ydAXbicDa_vcZHwDCrz3.M6VUeU3KvnAp3nq4kSFEpl89EhJCrgy7dKVa17S 1CAPTLZfahLX248AJGnqv8bjuxupk2lYjo8hPbFpkG0XHEH5gRcM6nERAakf Mj4rprU7zD1BQGmTmvx4h5o5iaWOogTeF2v8- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Wed, 5 Aug 2015 10:36:40 +1000 Message-Id: <1438735003-10626-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 Subject: [Piglit] [PATCH V2 1/4] arb_arrays_of_arrays: add some atomic counter indirect indexing 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:c03::22a 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: Initialise correct number of counters, fix testing of required max buffers --- .../atomic_counters/fs-indirect-index.shader_test | 71 +++++++++++++++++++ .../atomic_counters/vs-indirect-index.shader_test | 82 ++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-indirect-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-indirect-index.shader_test diff --git a/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-indirect-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-indirect-index.shader_test new file mode 100644 index 0000000..d935112 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-indirect-index.shader_test @@ -0,0 +1,71 @@ +# Simple test of accessing an atomic counter with dynamic indicies. +# + +[require] +GLSL >= 1.40 +GL_ARB_shader_atomic_counters +GL_ARB_arrays_of_arrays + +[vertex shader passthrough] + +[fragment shader] +#version 140 +#extension GL_ARB_shader_atomic_counters: require +#extension GL_ARB_arrays_of_arrays: require + +layout(binding = 0) uniform atomic_uint a0[2][4]; + +uniform int n; +uniform int m; + +in vec4 vcolor; +out vec4 fcolor; + +void main() +{ + bool passed = true; + uint v0[12]; + uint v1[12]; + + /* Get all initail values of a0 */ + v0[0] = atomicCounter(a0[0][0]); + v0[1] = atomicCounter(a0[0][1]); + v0[2] = atomicCounter(a0[0][2]); + v0[3] = atomicCounter(a0[0][3]); + v0[4] = atomicCounter(a0[1][0]); + v0[5] = atomicCounter(a0[1][1]); + v0[6] = atomicCounter(a0[1][2]); + v0[7] = atomicCounter(a0[1][3]); + + /* Test that incrementing, followed by a read of an atomic + * counter results in a larger value. + * Also test that all other array elements are unaffected. */ + atomicCounterIncrement(a0[0][0]); + atomicCounterIncrement(a0[n][m]); + v1[0] = atomicCounter(a0[0][0]); + v1[1] = atomicCounter(a0[0][1]); + v1[2] = atomicCounter(a0[0][2]); + v1[3] = atomicCounter(a0[0][3]); + v1[4] = atomicCounter(a0[1][0]); + v1[5] = atomicCounter(a0[1][1]); + v1[6] = atomicCounter(a0[1][2]); + v1[7] = atomicCounter(a0[1][3]); + if(v1[0] <= v0[0] || v1[1] != v0[1] || v1[2] != v0[2] || + v1[3] != v0[3] || v1[4] != v0[4] || v1[5] != v0[5] || + v1[6] <= v0[6] || v1[7] != v0[7]) + passed = false; + + if (passed) + fcolor = vec4(0.0, 1.0, 0.0, 1.0); + else + fcolor = vec4(1.0, 0.0, 0.0, 1.0); +} + +[test] +atomic counters 8 + +uniform int n 1 +uniform int m 2 + +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-indirect-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-indirect-index.shader_test new file mode 100644 index 0000000..d58b076 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-indirect-index.shader_test @@ -0,0 +1,82 @@ +# Simple test of accessing an atomic counter with dynamic indicies. +# + +[require] +GLSL >= 1.40 +GL_ARB_shader_atomic_counters +GL_ARB_arrays_of_arrays +INT GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS >= 1 + +[vertex shader] +#version 140 +#extension GL_ARB_shader_atomic_counters: require +#extension GL_ARB_arrays_of_arrays: require + +layout(binding = 0) uniform atomic_uint a0[2][4]; + +uniform int n; +uniform int m; + +in vec4 piglit_vertex; +out vec4 vcolor; + +void main() +{ + bool passed = true; + uint v0[12]; + uint v1[12]; + + /* Get all initail values of a0 */ + v0[0] = atomicCounter(a0[0][0]); + v0[1] = atomicCounter(a0[0][1]); + v0[2] = atomicCounter(a0[0][2]); + v0[3] = atomicCounter(a0[0][3]); + v0[4] = atomicCounter(a0[1][0]); + v0[5] = atomicCounter(a0[1][1]); + v0[6] = atomicCounter(a0[1][2]); + v0[7] = atomicCounter(a0[1][3]); + + /* Test that incrementing, followed by a read of an atomic + * counter results in a larger value. + * Also test that all other array elements are unaffected. */ + atomicCounterIncrement(a0[0][0]); + atomicCounterIncrement(a0[n][m]); + v1[0] = atomicCounter(a0[0][0]); + v1[1] = atomicCounter(a0[0][1]); + v1[2] = atomicCounter(a0[0][2]); + v1[3] = atomicCounter(a0[0][3]); + v1[4] = atomicCounter(a0[1][0]); + v1[5] = atomicCounter(a0[1][1]); + v1[6] = atomicCounter(a0[1][2]); + v1[7] = atomicCounter(a0[1][3]); + if(v1[0] <= v0[0] || v1[1] != v0[1] || v1[2] != v0[2] || + v1[3] != v0[3] || v1[4] != v0[4] || v1[5] != v0[5] || + v1[6] <= v0[6] || v1[7] != v0[7]) + passed = false; + + if (passed) + vcolor = vec4(0.0, 1.0, 0.0, 1.0); + else + vcolor = vec4(1.0, 0.0, 0.0, 1.0); + + gl_Position = piglit_vertex; +} + +[fragment shader] +#version 140 +in vec4 vcolor; +out vec4 fcolor; + +void main() +{ + fcolor = vcolor; +} + +[test] +atomic counters 8 + +uniform int n 1 +uniform int m 2 + +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0