From patchwork Sun Jul 5 07:18:14 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: 50665 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 ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6313B229FC for ; Sun, 5 Jul 2015 07:19:01 +0000 (UTC) Received: by laer2 with SMTP id r2sf38436434lae.3 for ; Sun, 05 Jul 2015 00:19: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: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=Z0h9OYmLTzRXAZM4HFX9eVwVRk7XJoLfiQQw74S3GoE=; b=TPXssMZ15d/SDVXDVMwEw7rEN3lqyO4Ljnj1UJPgnVtZoLcQjkzvfFGeE0irlg36f3 dSBobj8F6taCkNqoUFElIk98x4CMi+H7JmjjG6VfK3gMHxwe3ivxrM7So66+zpkJD/yP NAwSorzD4QUwCQVXHAXcm3OO0V0iNgQyoaICfRxq+YYc6XBwGlaqDahXiqvnz0Eo39u3 M3YbsA0DxjCel8knDpL5ebpEC6d1Ia7w1oHFtR5etrXXsq0A8CrB6+REz0j5/zKq7UX4 ezDvO7Y4TymA3Pb1hRCebvmuISIlaMQThwlWjlLF9R4T5wQul/eWvD/Oiynwf3jv8c+8 niRw== X-Gm-Message-State: ALoCoQl2S7zFgA85A7D3Pq6Wn6qr2/WDNyRxGsL3W4YRoQo5pmeLgT4J1MXd2QsdLnTeYgPNUltv X-Received: by 10.112.142.67 with SMTP id ru3mr27017060lbb.1.1436080740282; Sun, 05 Jul 2015 00:19:00 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.196 with SMTP id a4ls516765lak.27.gmail; Sun, 05 Jul 2015 00:19:00 -0700 (PDT) X-Received: by 10.152.10.72 with SMTP id g8mr42844149lab.97.1436080740020; Sun, 05 Jul 2015 00:19:00 -0700 (PDT) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com. [2a00:1450:4010:c03::22e]) by mx.google.com with ESMTPS id rs2si11950927lbb.106.2015.07.05.00.18.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Jul 2015 00:18:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22e as permitted sender) client-ip=2a00:1450:4010:c03::22e; Received: by laar3 with SMTP id r3so122976894laa.0 for ; Sun, 05 Jul 2015 00:18:59 -0700 (PDT) X-Received: by 10.112.42.50 with SMTP id k18mr39861197lbl.76.1436080739588; Sun, 05 Jul 2015 00:18:59 -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 hn6csp991888lbb; Sun, 5 Jul 2015 00:18:58 -0700 (PDT) X-Received: by 10.68.219.42 with SMTP id pl10mr94046255pbc.154.1436080738391; Sun, 05 Jul 2015 00:18:58 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id fd5si22898188pab.145.2015.07.05.00.18.57; Sun, 05 Jul 2015 00:18: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 4F4296E2D8; Sun, 5 Jul 2015 00:18:57 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm16-vm2.bullet.mail.gq1.yahoo.com (nm16-vm2.bullet.mail.gq1.yahoo.com [98.137.177.250]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C0766E34B for ; Sun, 5 Jul 2015 00:18:56 -0700 (PDT) Received: from [216.39.60.184] by nm16.bullet.mail.gq1.yahoo.com with NNFMP; 05 Jul 2015 07:18:56 -0000 Received: from [208.71.42.198] by tm20.bullet.mail.gq1.yahoo.com with NNFMP; 05 Jul 2015 07:18:56 -0000 Received: from [127.0.0.1] by smtp209.mail.gq1.yahoo.com with NNFMP; 05 Jul 2015 07:18:56 -0000 X-Yahoo-Newman-Id: 204799.47191.bm@smtp209.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: D4BlwgYVM1moyvylRLQIVXVoNXeb1oJICXdqDQgrgEU6vhQ xAVzz9XzyKe8LBsUfdQ05oqCg4IrLyAVgaq64QcuqiLIf4oD7JcW4xm5YkJT USquCH9FWvkUYuU6YbwSc6330z136Xw2ZgHSRabpD6vGfwXuP8R5SWTcRj8C J88khOckrd2fz8dldXTquB7BZ0j7gBfZQS_uwjo6JCOw7X4MvOUz88PKfOrb umxSs7o5RxpIjtgvuEPhMqampHCd1AAQYcPdEVug2u_JOxNuksVx4MaeFPQ2 st7iYLHyAF4ggtIA3TMIVf9vFutv.KU3Tc_vEL6zNMBa44AHpC3AoWwUbQ63 3_Dfs_vXXTg.hflNiY4cYA6stiIvMv5vzVr4OVsDPWUmuYHRGGW66so7D2Qm YWonUHHE86F6PFqGkvx30CHLu7C_3jkwVUqptPtr32IG3Z6Bz0m2826zlXrX AP64jvPCcrRz8ITyut_WjlEbR18Dek2OkEbJtBgBHtoknTSPIX5fIB2cu3tn OLSgBOsKwRLLq1akI3KdLDiCHAfP8AZ7CKJU- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sun, 5 Jul 2015 17:18:14 +1000 Message-Id: <1436080696-9702-4-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1436080696-9702-1-git-send-email-t_arceri@yahoo.com.au> References: <1436080696-9702-1-git-send-email-t_arceri@yahoo.com.au> Subject: [Piglit] [PATCH V3 4/6] 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:c03::22e 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