From patchwork Sun Aug 2 12:04:56 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: 51801 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 21237229FD for ; Sun, 2 Aug 2015 12:05:20 +0000 (UTC) Received: by labjb5 with SMTP id jb5sf384221lab.1 for ; Sun, 02 Aug 2015 05:05:18 -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=+5JaEJo9cB+FMF4Sei7KEAA0VTBwhe/ciiiqMtu+G/k=; b=jR2yFhs8DNA5THJ2amHfIPvE7bVAh44ca+KIry/3R1pr5izoDRJNbpk+cEXVMfCGL9 K31slRL9CYRmmKDpJ890C+O8U5uCc4Yi+Ee91w0S5DyogiAfy74wng6qpwgZo5V+XooP 2T5s4mMNYF/onvAYQ7iZXenoXwDHZopWheutH72i0FsutY9zy9Hm2FpxJB9aUUX8rhXt nGjY1v5AhVOr9jK2aHr67pCXrWavQfVaoj8n9Q9bjBK1ezLEQzk/nxvH+Wp2E4N1HkP7 esp4E0QXarkrVLzlu5R/4IK5DZcWiVPVad2X4BCjkt2lCY/ixjRV0xEYa+QRfqW/Yqme oJ3A== X-Gm-Message-State: ALoCoQl+Dv7BZRylLfyxK1pUZwV6bZQU6yojpmqipoNjLDORHteN1LGgfLblWJ/wnfDZn7LCKguO X-Received: by 10.194.19.33 with SMTP id b1mr1236668wje.6.1438517118510; Sun, 02 Aug 2015 05:05:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.73 with SMTP id k9ls432347lam.66.gmail; Sun, 02 Aug 2015 05:05:18 -0700 (PDT) X-Received: by 10.112.64.172 with SMTP id p12mr7639238lbs.38.1438517118253; Sun, 02 Aug 2015 05:05:18 -0700 (PDT) Received: from mail-la0-x22c.google.com (mail-la0-x22c.google.com. [2a00:1450:4010:c03::22c]) by mx.google.com with ESMTPS id lg8si9264979lab.107.2015.08.02.05.05.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 05:05:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22c as permitted sender) client-ip=2a00:1450:4010:c03::22c; Received: by labow3 with SMTP id ow3so694703lab.1 for ; Sun, 02 Aug 2015 05:05:18 -0700 (PDT) X-Received: by 10.112.145.169 with SMTP id sv9mr12293269lbb.73.1438517118144; Sun, 02 Aug 2015 05:05:18 -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 l6csp1363582lba; Sun, 2 Aug 2015 05:05:16 -0700 (PDT) X-Received: by 10.70.103.145 with SMTP id fw17mr26439894pdb.1.1438517116066; Sun, 02 Aug 2015 05:05:16 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id qa4si7712713pbb.52.2015.08.02.05.05.15; Sun, 02 Aug 2015 05:05:16 -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 015F26E1D8; Sun, 2 Aug 2015 05:05:15 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm25-vm9.bullet.mail.gq1.yahoo.com (nm25-vm9.bullet.mail.gq1.yahoo.com [98.136.217.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E4D26E1D8 for ; Sun, 2 Aug 2015 05:05:13 -0700 (PDT) Received: from [216.39.60.180] by nm25.bullet.mail.gq1.yahoo.com with NNFMP; 02 Aug 2015 12:05:12 -0000 Received: from [98.136.164.72] by tm16.bullet.mail.gq1.yahoo.com with NNFMP; 02 Aug 2015 12:05:12 -0000 Received: from [127.0.0.1] by smtp234.mail.gq1.yahoo.com with NNFMP; 02 Aug 2015 12:05:12 -0000 X-Yahoo-Newman-Id: 793529.76184.bm@smtp234.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: qkQr2dcVM1n2_n0sgXaDzxmpD5bXtOFAbIl7kC5npK4wFLT d3K2B6v3_CXQAQtfEs6xuiIs48UJHtw5hXCGmLSZEEQTR9CwAAVuwm2Uv0fe 9a3e3_FJsOyU5VfDAe14fepeZ61tUFNPWNLS1csezjM6KCb_slx50YVbIFZ_ R01Pm5MX938_spccnWhhdf4b8aQDEiOSFH8BqCf9j7A_2BCgYjlFC19jSpbt 9AVjQpdlzfXGZoKmVIkXS925Qtv_gAb6jmeH0qlbaQVT8InBPaUQlI0FC0OC 2YRkISLXwxxllYvzt2VazMWiQ1RZxGizzNh28rSPUPP6F75iacG986TnWS34 JbWPWYemQ1r1BYtZ3.1Y9iQEqdJMwZTiFcumTbGYm2ZUF95qMrkS_DzPUB4Y jdiD2vgS1pPVgWIHd5KrAYIhtT8XDhnRRR.g65OdJq8r_7r_pL7STl92Kakp LhLlWQYLHhQBiuOr9DjuLDaCS.uEhn0LeR1BVAQVGBzE7OVu_0EyKkwua0gv CNcUk3b07p47HJ44LxPcZGAlKcozQGiQ.6wM- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sun, 2 Aug 2015 22:04:56 +1000 Message-Id: <1438517096-3686-3-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1438517096-3686-1-git-send-email-t_arceri@yahoo.com.au> References: <1438517096-3686-1-git-send-email-t_arceri@yahoo.com.au> Subject: [Piglit] [PATCH 3/3] 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::22c 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 --- .../fs-simple-inc-dec-read.shader_test | 109 +++++++++++++++++++++ 1 file changed, 109 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..cce0716 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-simple-inc-dec-read.shader_test @@ -0,0 +1,109 @@ +# 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 +INT GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS >= 2 + +[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 2 + +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0