From patchwork Wed Aug 5 00:36:42 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: 51942 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by patches.linaro.org (Postfix) with ESMTPS id 9E61422E8E for ; Wed, 5 Aug 2015 00:37:05 +0000 (UTC) Received: by lbcjf8 with SMTP id jf8sf8147952lbc.0 for ; Tue, 04 Aug 2015 17:37:04 -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=87mkfJA96uga6HOqBtqjPquaiWP5DDJSOqKYh8tv8CU=; b=ASn0r9G4rsmBArHNAXUNMGBIT3UOJzHFa7rXRJcGNwccWStjtOrM58wEXmcM8B1UzA sgPBBhLn05rkO57XO9UFSR0C1Ik32E4MRuSdYVxXtm+buryaxBPG8d7rvxjSSO9kjx8m iJ2Iv+aynxYDpL3JRunxbXw999zWVIpJWWYaasmmXL/R1OAAVglFOqTPM2ymIxI7wavt 96c1BN//t0yh0tszxVIo7C1ia0G6PYvjStpRkIb3XR3zq2vxxsuUCWK5iec2daO8JkXH Thpqn+mCZ961IxOQ/ltzRk0dUFAv+GdVGAth5eUaBEdZCtZ3dkhlyt1K5+Sf9MVzb6JL PF1Q== X-Gm-Message-State: ALoCoQk5jgrklrS3tbcRzbMPyVtKPADZDLBbAHtZhvDPGuMIoxoBVGFvUrVZmqkK8Hyj89q+k1Vm X-Received: by 10.112.173.230 with SMTP id bn6mr1862461lbc.15.1438735024611; Tue, 04 Aug 2015 17:37:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.201 with SMTP id p9ls121944lae.42.gmail; Tue, 04 Aug 2015 17:37:04 -0700 (PDT) X-Received: by 10.112.185.66 with SMTP id fa2mr6979006lbc.42.1438735024235; Tue, 04 Aug 2015 17:37:04 -0700 (PDT) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com. [2a00:1450:4010:c03::234]) by mx.google.com with ESMTPS id b8si1015091lbg.101.2015.08.04.17.37.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 17:37:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::234 as permitted sender) client-ip=2a00:1450:4010:c03::234; Received: by labgo9 with SMTP id go9so18292163lab.3 for ; Tue, 04 Aug 2015 17:37:04 -0700 (PDT) X-Received: by 10.112.158.4 with SMTP id wq4mr7012634lbb.106.1438735024134; Tue, 04 Aug 2015 17:37:04 -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 l6csp69220lba; Tue, 4 Aug 2015 17:37:02 -0700 (PDT) X-Received: by 10.68.113.37 with SMTP id iv5mr13622903pbb.104.1438735022120; Tue, 04 Aug 2015 17:37:02 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id x2si2138118pdi.17.2015.08.04.17.37.01; Tue, 04 Aug 2015 17:37:02 -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 0EE296E77E; Tue, 4 Aug 2015 17:37:01 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm14-vm6.bullet.mail.gq1.yahoo.com (nm14-vm6.bullet.mail.gq1.yahoo.com [98.136.218.78]) by gabe.freedesktop.org (Postfix) with ESMTPS id A60D46E77E for ; Tue, 4 Aug 2015 17:36:59 -0700 (PDT) Received: from [98.137.12.59] by nm14.bullet.mail.gq1.yahoo.com with NNFMP; 05 Aug 2015 00:36:59 -0000 Received: from [98.136.164.65] by tm4.bullet.mail.gq1.yahoo.com with NNFMP; 05 Aug 2015 00:36:59 -0000 Received: from [127.0.0.1] by smtp227.mail.gq1.yahoo.com with NNFMP; 05 Aug 2015 00:36:59 -0000 X-Yahoo-Newman-Id: 394458.84524.bm@smtp227.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: x5tH.QwVM1mSQpy2Jhv9IPkuJSXnHvUgKIh_TsQa7jTj2yz 4D5InhyzLRMwdMkhp0h3Hn33B95c8sLuwSnZKeEJx42.X8kq32_7aovf8WnZ ECHeuvogA._lgmHACqFBaCaSftHhIuPs8v9m6Ll1R.rrSrLZk2n.fYgkaP71 RXqRlcwBp3tk59siPrwP47Ooeaxe5FMrO5uaO6QxhSLxzWSr35EF1EBe7YSL ZcfkquS9rHbwiXBkzFwzWPijCj98bGhnjfH7ppyEugEBh6DRI9E0nX2NoSAw kreS1i79AalAxUr1jqkSM4iYAZIjORwO6Y59noDvvYkGaTRZ8wwQj0Jd8m5f AmoK93ogHukf.YScG30sI983UEiUgOJPMYBZfjWgZB9u.I1SuzRW3wEgAVL. QBsP49EkGa1rWrk523OSzdComWHxZ.ff7zi2Pdu._T4ZwLWYV_Hew5ukLrke jMJDTlj9W9pqCvghIEb4NKMZI1NjzXmcawJSQHw9DvJn5wbm5jyHEtwvjJ_9 5.JqeqF05W9EQtGI4M8rNuLmS0QwiZAurZ_s- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Wed, 5 Aug 2015 10:36:42 +1000 Message-Id: <1438735003-10626-3-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1438735003-10626-1-git-send-email-t_arceri@yahoo.com.au> References: <1438735003-10626-1-git-send-email-t_arceri@yahoo.com.au> Subject: [Piglit] [PATCH V2 3/4] arb_arrays_of_arrays: add simple fs atomic counter execution 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:c03::234 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, remove incorrect testing of max buffer --- .../fs-simple-inc-dec-read.shader_test | 108 +++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-simple-inc-dec-read.shader_test diff --git a/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-simple-inc-dec-read.shader_test b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-simple-inc-dec-read.shader_test new file mode 100644 index 0000000..68ddc46 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-simple-inc-dec-read.shader_test @@ -0,0 +1,108 @@ +# Simple test of atomicCounterIncrement, atomicCounterDecrement and +# atomicCounter being used in the FS. + +[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]; +layout(binding = 0) uniform atomic_uint a1[3][2][2]; + +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[1][2]); + 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; + + /* Skip one decrement since it may be the 0 => 0xffffffff + * transition. + */ + atomicCounterDecrement(a1[0][1][1]); + atomicCounterDecrement(a1[2][0][1]); + + /* Get all initail values of a1 */ + v0[0] = atomicCounter(a1[0][0][0]); + v0[1] = atomicCounter(a1[0][0][1]); + v0[2] = atomicCounter(a1[0][1][0]); + v0[3] = atomicCounter(a1[0][1][1]); + v0[4] = atomicCounter(a1[1][0][0]); + v0[5] = atomicCounter(a1[1][0][1]); + v0[6] = atomicCounter(a1[1][1][0]); + v0[7] = atomicCounter(a1[1][1][1]); + v0[8] = atomicCounter(a1[2][0][0]); + v0[9] = atomicCounter(a1[2][0][1]); + v0[10] = atomicCounter(a1[2][1][0]); + v0[11] = atomicCounter(a1[2][1][1]); + + /* Test that a decrement of an atomic + * counter results in a smaller value. + * Also test that all other array elements are unaffected. + */ + v1[0] = atomicCounter(a1[0][0][0]); + v1[1] = atomicCounter(a1[0][0][1]); + v1[2] = atomicCounter(a1[0][1][0]); + v1[3] = atomicCounterDecrement(a1[0][1][1]); + v1[4] = atomicCounter(a1[1][0][0]); + v1[5] = atomicCounter(a1[1][0][1]); + v1[6] = atomicCounter(a1[1][1][0]); + v1[7] = atomicCounter(a1[1][1][1]); + v1[8] = atomicCounter(a1[2][0][0]); + v1[9] = atomicCounterDecrement(a1[2][0][1]); + v1[10] = atomicCounter(a1[2][1][0]); + v1[11] = atomicCounter(a1[2][1][1]); + + 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] || v1[8] != v0[8] || + v1[9] >= v0[9] || v1[10] != v0[10] || v1[11] != v0[11]) + 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 20 + +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0