From patchwork Mon Jun 8 02:18:00 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: 49606 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6D3ED22B3F for ; Mon, 8 Jun 2015 02:18:46 +0000 (UTC) Received: by wizw5 with SMTP id w5sf11044880wiz.2 for ; Sun, 07 Jun 2015 19:18:45 -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=Bx7uuE6bBWWi8lyZMEjegAUYwR9I9dhPWhIL1hjsiopZ9fI6CARq2BBV2zyvqmU+z1 d3lXZe0eNTjYE2cfTaAr2iAGSn+dOviJD1NplCbUNA2i6oAI+WcpGQpbQEAa8L3x6SjZ 00GXXiXlzfqcBIH2ETGjWmi8fAo3eeaJTpWuoT03qieNoOSiKD0Kbba3YtSYWYBZiMjh +C8sVJmAT4LHsX7qkqFNgEr/vmj6RtNGn60msodX5YNTyVQ6MddinmP7F9+TwVQRzgR4 Sl07gAM2ETiPgG17Hji6XYTBhZsy0YVquPQlz2QcLmm2ZB3Wd9O4thVHUx/sznJqWWql FPYw== X-Gm-Message-State: ALoCoQle+u+LnNpiDLChP4D3W34cjkoHdvylrqGCMH2Sc4IGgeOkusav8jSLdrIhIbayUv5m8K/h X-Received: by 10.180.187.175 with SMTP id ft15mr10260928wic.4.1433729925695; Sun, 07 Jun 2015 19:18:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.8.171 with SMTP id dl11ls559319lad.55.gmail; Sun, 07 Jun 2015 19:18:45 -0700 (PDT) X-Received: by 10.112.134.167 with SMTP id pl7mr14150942lbb.50.1433729925562; Sun, 07 Jun 2015 19:18:45 -0700 (PDT) Received: from mail-lb0-x232.google.com (mail-lb0-x232.google.com. [2a00:1450:4010:c04::232]) by mx.google.com with ESMTPS id x5si1295287lal.69.2015.06.07.19.18.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jun 2015 19:18:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::232 as permitted sender) client-ip=2a00:1450:4010:c04::232; Received: by lbcue7 with SMTP id ue7so71886711lbc.0 for ; Sun, 07 Jun 2015 19:18:45 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr14391128lbc.86.1433729925461; Sun, 07 Jun 2015 19:18:45 -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 hn6csp1521833lbb; Sun, 7 Jun 2015 19:18:44 -0700 (PDT) X-Received: by 10.70.124.233 with SMTP id ml9mr25574540pdb.9.1433729923626; Sun, 07 Jun 2015 19:18:43 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id fj8si1767392pdb.93.2015.06.07.19.18.42; Sun, 07 Jun 2015 19:18:43 -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 9245B6E154; Sun, 7 Jun 2015 19:18:42 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm27-vm10.bullet.mail.gq1.yahoo.com (nm27-vm10.bullet.mail.gq1.yahoo.com [98.136.216.153]) by gabe.freedesktop.org (Postfix) with ESMTP id F1D8D6E154 for ; Sun, 7 Jun 2015 19:18:41 -0700 (PDT) Received: from [98.137.12.62] by nm27.bullet.mail.gq1.yahoo.com with NNFMP; 08 Jun 2015 02:18:41 -0000 Received: from [98.136.164.76] by tm7.bullet.mail.gq1.yahoo.com with NNFMP; 08 Jun 2015 02:18:41 -0000 Received: from [127.0.0.1] by smtp238.mail.gq1.yahoo.com with NNFMP; 08 Jun 2015 02:18:41 -0000 X-Yahoo-Newman-Id: 387910.17301.bm@smtp238.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 31rfgAwVM1lORuXpRtVAb2Brvnx4x24WxWCxACRC4MRGWwA .LDkDPM0e1RafEkAYYnWCkKWPQmlcqCq7reTog1lnB_g1CzG9WACUY8WrfAU YDC5br8oVaZ25gTVhmYAEZp.kg1FEsr.sNSLPl1Y.uxe0FvF_63HBG7XnMEd bffaNcm3b8mRWPLXz8xBFOC_anNWRGQI.0pIkIhZkcHhjecTsw4UorYGux.3 aQlnF8zlNTvUFQRTk0wtSTB1v5AugTTVoLaIBF0ftUZAjt.h8aTv2xPx_sRD stGqok.YdGWcHkX8etQV6IQXla_QGV9i.70QMftxPajelD0f4V9NJh5jFRDR MfUyM3sZqaN4WAxhVAwyY3zyP15M1_.EklKM6BZN.QKwgWgnHskEnv3cPmTf HcIHe_wLT8ATg2r4t30wlJJOIxmwvEEVuJ0SyDY7RP1G.2.kYyv_rVlFZOeu jhItjfRk_L5LCYb4xlXCP2_rfbcGKHXLxnREVr3tT8jyplZBEHEdZvqvGXF_ WBE1Sh5Lmb8qK8bhVGYC.K9vXfxnNRow6NyE- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Mon, 8 Jun 2015 12:18:00 +1000 Message-Id: <1433729882-5502-2-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1433729882-5502-1-git-send-email-t_arceri@yahoo.com.au> References: <1433729882-5502-1-git-send-email-t_arceri@yahoo.com.au> Subject: [Piglit] [PATCH 2/4] 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::232 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