From patchwork Sun Aug 2 12:04:54 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: 51799 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id 65F74229FD for ; Sun, 2 Aug 2015 12:05:11 +0000 (UTC) Received: by lbcjj5 with SMTP id jj5sf36408395lbc.1 for ; Sun, 02 Aug 2015 05:05:10 -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: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=SgoWd2EQyyyoJbbFxMNvdKMP8xQgehlxZFlAESjj76M=; b=MeA70ofB9Tj2Wav0q3hDZYf1vrDAvr/AVZOiLK/P0BSAyPoZmFrwn10wjPDzI9CnB0 AcGveg/17e2gRLz0wlYmhFmJY7gSNj+Kl5BU5F9vX0UjLsiXXZc7/Sw1why8JEAQuJnP QAMMDMHNeZWqlQHvWL0rBjoAgmySLLSk7aBntpS4BA7qe+IuGriERjGUiiLT0n+Fnx8Y OOR5OFmsMgdbbnZzEvZo5TgemgLWCs3UR/a1RhXLPo8UIWAMVGvZAvbDcDhrUd2UFEZ4 pPcJhab51RDJimHMinJPyhvH0m/DTE1//4zxpTCBPXy0cTxEJrJ6VaSi2EM1FnSz95kV 0qLQ== X-Gm-Message-State: ALoCoQndEuEq0Ey1sdYj/Vb8gYdNZX73qKk2eTiqtgiCRMvAyBf11wisBXw3ZQErQNVFwwIh+k4c X-Received: by 10.112.215.67 with SMTP id og3mr3973671lbc.8.1438517109674; Sun, 02 Aug 2015 05:05:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.163.65 with SMTP id yg1ls441588lab.26.gmail; Sun, 02 Aug 2015 05:05:09 -0700 (PDT) X-Received: by 10.152.43.228 with SMTP id z4mr7055785lal.99.1438517109421; Sun, 02 Aug 2015 05:05:09 -0700 (PDT) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com. [2a00:1450:4010:c04::22f]) by mx.google.com with ESMTPS id eq12si9244200lac.171.2015.08.02.05.05.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 05:05:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22f as permitted sender) client-ip=2a00:1450:4010:c04::22f; Received: by lbbud7 with SMTP id ud7so61842124lbb.3 for ; Sun, 02 Aug 2015 05:05:09 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr11955293lbc.41.1438517109282; Sun, 02 Aug 2015 05:05:09 -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 l6csp1363515lba; Sun, 2 Aug 2015 05:05:07 -0700 (PDT) X-Received: by 10.70.92.138 with SMTP id cm10mr26270919pdb.63.1438517107728; Sun, 02 Aug 2015 05:05:07 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id kl8si21328939pdb.48.2015.08.02.05.05.06; Sun, 02 Aug 2015 05:05:07 -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 525986E079; Sun, 2 Aug 2015 05:05:06 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm16-vm5.bullet.mail.gq1.yahoo.com (nm16-vm5.bullet.mail.gq1.yahoo.com [98.137.177.253]) by gabe.freedesktop.org (Postfix) with ESMTPS id B32AA6E079 for ; Sun, 2 Aug 2015 05:05:04 -0700 (PDT) Received: from [98.137.12.63] by nm16.bullet.mail.gq1.yahoo.com with NNFMP; 02 Aug 2015 12:05:03 -0000 Received: from [98.136.164.72] by tm8.bullet.mail.gq1.yahoo.com with NNFMP; 02 Aug 2015 12:05:03 -0000 Received: from [127.0.0.1] by smtp234.mail.gq1.yahoo.com with NNFMP; 02 Aug 2015 12:05:03 -0000 X-Yahoo-Newman-Id: 613271.76184.bm@smtp234.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: OtCDARoVM1lEdOQWBhm6Hw4Y.Z1M8iwzgOHMvdBTCpX5Fxr 3H_Jr9kzIWowwQe8YBW3zfzS0fLymFt5oqv.y_DLD1Sb.RFxSuitWEsX5jZk vwXInwCTPfvBz4nCSynNZ80eV4cN1ffLZot9MOTJFTUzMBoUO8SKAFyPVIRW ExHiVDvL6H8Bv3EhFVLYPr.POuc5YsNKaJ2uFbLyUlcvLsEzkIu2UrktI72w gkY2VHRmkS1SYMcYr9tJ33uGc10dEiwZFzT0xDxmQB_K6T8Vqnycb9G5d1N1 K0KLxqQ.8CaOUBpNvZR02OJj.q.FnrI8pssRGpT4g58BYSDFwyzgWI8OqpxA lpBDQ_T.qobzVYxQApSqTJoPk08csFsx_RdCVHViWrfKGS.weVxeLrikFOIE x6Z6dGfX3ql3m5b6E3Mez9pxFc0UChkxZ4S7RPtvPj2okvDPbbfppJmFVDKu 8Bq_U0Pn5W33PtI0b2b.qbiw3u8pXFegy8jnZjaEce48autOlTxhVBh4GJW6 86ea4YHx4R5slg0w.cIXXsQkUzUE6GmF_qs0- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sun, 2 Aug 2015 22:04:54 +1000 Message-Id: <1438517096-3686-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 Subject: [Piglit] [PATCH 1/3] arb_arrays_of_arrays: add some atomic counter indirect indexing tests 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::22f 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 --- .../atomic_counters/fs-indirect-index.shader_test | 72 +++++++++++++++++++ .../atomic_counters/vs-indirect-index.shader_test | 82 ++++++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-indirect-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-indirect-index.shader_test diff --git a/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-indirect-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-indirect-index.shader_test new file mode 100644 index 0000000..0039855 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-indirect-index.shader_test @@ -0,0 +1,72 @@ +# Simple test of accessing an atomic counter with dynamic indicies. +# + +[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]; + +uniform int n; +uniform int m; + +in vec4 vcolor; +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[n][m]); + 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; + + 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 + +uniform int n 1 +uniform int m 2 + +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-indirect-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-indirect-index.shader_test new file mode 100644 index 0000000..cadba11 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-indirect-index.shader_test @@ -0,0 +1,82 @@ +# Simple test of accessing an atomic counter with dynamic indicies. +# + +[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]; + +uniform int n; +uniform int m; + +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[n][m]); + 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; + + 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 + +uniform int n 1 +uniform int m 2 + +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0