From patchwork Sat Jun 20 12:14:33 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: 50127 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A83BF21594 for ; Sat, 20 Jun 2015 12:15:15 +0000 (UTC) Received: by wizw5 with SMTP id w5sf11401079wiz.2 for ; Sat, 20 Jun 2015 05:15:15 -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=aYwt5M7yaY90tqUBjxWGpU5jYJXgZYiyz1ftz9AJTtk=; b=W/YDyRj4UXlmBfCOhmzWQrQdbgkZwgagKZlyGMFjrG0rd7mgOHAluyVsaVQRsSoBrM hO5RuL8hlJ1j6xFvDROrnHwfS9UVl1/Oq4vddbju4Qlf2XpgenL8fAR3gV0nEuD2P9mg nimY6YsEwI2EIlcPWIH/t+MWty063V1eXfwCoLnrK+ZkKsaEwQSr6prn7fejJbVc17sp b8ixxDAWfIXqrYvZ4l3cUEFp6iAcO4twGMKTDGJt+oVCz3eTmXlzdQ3lAB1bIu/ZpmZI VRw+/4kPLaDqU5RIni5Vlqju3JEEzgvetxGOWRAZTTumjUKH5MKRmmIVCPVifXSoOvv7 xh4A== X-Gm-Message-State: ALoCoQk2EW81ukaulz70etygyLcsxz0bU27ktJijhls8uB0oY9lT6XyS4k9iMWEW1qAFMPCuHA/8 X-Received: by 10.112.26.5 with SMTP id h5mr19626114lbg.4.1434802514945; Sat, 20 Jun 2015 05:15:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.129 with SMTP id s1ls802935las.89.gmail; Sat, 20 Jun 2015 05:15:14 -0700 (PDT) X-Received: by 10.152.19.8 with SMTP id a8mr21933670lae.121.1434802514823; Sat, 20 Jun 2015 05:15:14 -0700 (PDT) Received: from mail-lb0-x22b.google.com (mail-lb0-x22b.google.com. [2a00:1450:4010:c04::22b]) by mx.google.com with ESMTPS id y5si11637853lay.123.2015.06.20.05.15.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jun 2015 05:15:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22b as permitted sender) client-ip=2a00:1450:4010:c04::22b; Received: by lbbvz5 with SMTP id vz5so37597146lbb.0 for ; Sat, 20 Jun 2015 05:15:14 -0700 (PDT) X-Received: by 10.152.27.1 with SMTP id p1mr21717927lag.112.1434802514711; Sat, 20 Jun 2015 05:15:14 -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 hn6csp1209503lbb; Sat, 20 Jun 2015 05:15:13 -0700 (PDT) X-Received: by 10.66.121.101 with SMTP id lj5mr40626739pab.113.1434802511310; Sat, 20 Jun 2015 05:15:11 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id bv14si20976233pdb.125.2015.06.20.05.15.10; Sat, 20 Jun 2015 05:15:11 -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 34F546E705; Sat, 20 Jun 2015 05:15:10 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm2-vm1.bullet.mail.gq1.yahoo.com (nm2-vm1.bullet.mail.gq1.yahoo.com [98.136.218.128]) by gabe.freedesktop.org (Postfix) with ESMTP id BA3916E705 for ; Sat, 20 Jun 2015 05:15:08 -0700 (PDT) Received: from [98.137.12.188] by nm2.bullet.mail.gq1.yahoo.com with NNFMP; 20 Jun 2015 12:15:08 -0000 Received: from [208.71.42.199] by tm9.bullet.mail.gq1.yahoo.com with NNFMP; 20 Jun 2015 12:15:08 -0000 Received: from [127.0.0.1] by smtp210.mail.gq1.yahoo.com with NNFMP; 20 Jun 2015 12:15:08 -0000 X-Yahoo-Newman-Id: 589496.61572.bm@smtp210.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: RzP.QsIVM1mh9VCFbum9dW5IZaY5VrV1jgL.TaJvMfdMb7l vQ947Vb0geWgDOCvVqcPVTUaZ5GqrOBSv4LnZkry7QI5Y0zHpJTeRHhsZIfG ES7sEMdly9M2Sz.t5IQFJKeYUILN.QS8a2.h85bH9oMRt4r_tSQp4pAkHQUH 3RpZ9ATrxzm.Y.mabxuoq0S2vVHZ1WeWGNsFGFtEUruf8cjIRuHZqL5ZsuGK 6pEEIwfhm8MNVBhjhAsSF8Hq5cAZyXTquSA7IZOyVjS5FCXo8Vkuaa8gDkUE eeE1zCgMFtfbEq9NIGsTA6rUqdyD9ltje7oqHaY4etyyr6nnJcy2ATc8M.75 isol1UOh2FSU_RmmGyifbWdbhQCwt7WeusFvGR.Rnjw07sjZb44t1CLwXLqw AIKaGixLZUAOMNIrr3Fd2uBgiRPldgoOpJr1MTmo8bcQArMco.7D6XtO_nXs 8WMYlYRAqyw_0q1tzjFhDzZUStLSdWTV4KDfAUMjpUBrZX42BJT6lMOKxJdg GHXn4GfjT7sPI5ps9jDw4WrhF4OAe1pJUpXQ- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sat, 20 Jun 2015 22:14:33 +1000 Message-Id: <1434802475-4020-6-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 6/8] arb_arrays_of_arrays: add simple atomic counters 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:c04::22b 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 --- .../vs-simple-inc-dec-read.shader_test | 119 +++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test diff --git a/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test new file mode 100644 index 0000000..4233448 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test @@ -0,0 +1,119 @@ +# Simple test of atomicCounterIncrement, atomicCounterDecrement and +# atomicCounter being used in the VS. + +[require] +GLSL >= 1.40 +GL_ARB_shader_atomic_counters +GL_ARB_arrays_of_arrays +INT GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS >= 2 + +[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]; +layout(binding = 0) uniform atomic_uint a1[3][2][2]; + +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[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; + + /* 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][0]); + v0[6] = atomicCounter(a1[1][0][1]); + v0[7] = atomicCounter(a1[1][1][0]); + v0[8] = atomicCounter(a1[2][0][0]); + v0[9] = atomicCounter(a1[2][0][0]); + v0[10] = atomicCounter(a1[2][0][1]); + v0[11] = atomicCounter(a1[2][1][0]); + + /* Skip one decrement since it may be the 0 => 0xffffffff + * transition. + */ + atomicCounterDecrement(a1[2][0][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) + 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 2 + +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0