From patchwork Sun Sep 27 07:17:45 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: 54187 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 0101122A0D for ; Sun, 27 Sep 2015 07:17:57 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf25199858wic.1 for ; Sun, 27 Sep 2015 00:17:56 -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=JTHadZVCIbTuX5HubMAivB4taubGRwIdrIpbU2mK7Ns=; b=ACsu5wUG8KkXegN4pYglk1OA3amRV2+g6DFx/2c0L14WYDoZ2eqfxwddKQwCuqrCBE 5zK37P+JSMukU1jXD0kJmUuj2krt1gQSjBeRxCxx9VzDJrm4E3vAJf/j9DauZMow1dAU yE3YEVibShg/6NWesh8dScRHLT2hqvGGcxNuWVqdCc12HhqSrbqPFgJmA15aFQYdwB67 JblZ2XvIU5MJMY2gr45IWkYFcHV65bz1Nr1gDet60kMjKBxmdCoCbRWSw8+QNWUkZ0Up VjwCKUWamrD+Ax1IXNXtcwPiVjGIZ3yCb8j4dRw35GIaRyYznQEKF5Saa69w8KtNfcN0 YoFA== X-Gm-Message-State: ALoCoQlsZBdA7iRcVdGmv6Qy4FXlVgES0Lvv8wM/+l6DL1/8b11tOt2sbabvtT2ughn/nVYuBity X-Received: by 10.180.105.98 with SMTP id gl2mr1843354wib.0.1443338276330; Sun, 27 Sep 2015 00:17:56 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.20.203 with SMTP id 72ls294020lfu.95.gmail; Sun, 27 Sep 2015 00:17:56 -0700 (PDT) X-Received: by 10.152.9.67 with SMTP id x3mr3823591laa.111.1443338276069; Sun, 27 Sep 2015 00:17:56 -0700 (PDT) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com. [2a00:1450:4010:c03::231]) by mx.google.com with ESMTPS id jc9si1253193lac.106.2015.09.27.00.17.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Sep 2015 00:17:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::231 as permitted sender) client-ip=2a00:1450:4010:c03::231; Received: by laer8 with SMTP id r8so3070810lae.2 for ; Sun, 27 Sep 2015 00:17:55 -0700 (PDT) X-Received: by 10.112.199.70 with SMTP id ji6mr3909512lbc.73.1443338275874; Sun, 27 Sep 2015 00:17:55 -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.59.35 with SMTP id w3csp901768lbq; Sun, 27 Sep 2015 00:17:54 -0700 (PDT) X-Received: by 10.69.16.166 with SMTP id fx6mr18549729pbd.18.1443338274541; Sun, 27 Sep 2015 00:17:54 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id jv8si18303412pbc.136.2015.09.27.00.17.54; Sun, 27 Sep 2015 00:17:54 -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 CE0926E275; Sun, 27 Sep 2015 00:17:53 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm26-vm7.bullet.mail.gq1.yahoo.com (nm26-vm7.bullet.mail.gq1.yahoo.com [98.136.216.134]) by gabe.freedesktop.org (Postfix) with ESMTPS id A841F6E275 for ; Sun, 27 Sep 2015 00:17:52 -0700 (PDT) Received: from [98.137.12.190] by nm26.bullet.mail.gq1.yahoo.com with NNFMP; 27 Sep 2015 07:17:52 -0000 Received: from [208.71.42.213] by tm11.bullet.mail.gq1.yahoo.com with NNFMP; 27 Sep 2015 07:17:51 -0000 Received: from [127.0.0.1] by smtp224.mail.gq1.yahoo.com with NNFMP; 27 Sep 2015 07:17:51 -0000 X-Yahoo-Newman-Id: 899232.79076.bm@smtp224.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: n3NVvtUVM1l47ssdHGQJCNVF6SiPn07aTbbRoVdVaACZo3w 2JjLNquMMgZNqF2ln5qrn04w0UjxE19nHYqgWj3L4H7YRGe0EJi2xAxWQQX1 ghMLT9uZkLdg.xutuH32fpPUtmTKliKqjRZUnIRtXTXkE1rn2K48gtnZ7J99 GgBk2JDU0Q8GB6gfSwxN_ykZ1vaO0z0RSAaG1Q.hc5AcrSF5Kaowa8NZancR 8acUYDfHP.mi37AHy56Yhw72AXSXvaXc_IT4rkGPPnCnkR4HjsQRDWCOHmHw 3mDH26.P5VR5ovj84oG2DIeBJKxeIg96YsM6py6441U2V7RjGmP1nH_cCl4Q UyezoCH1HZU8hxrybPxdCdHFuEJQzEs_WT1uQFLK4RMfUibGZ1TKDRnKOA0p wm9wsmoQ5pk7ApFSsR.Z8pemTs8yIBlMVXmJ8oxJ1w2serMjrsttgpYWjWyW yNBxq4fPq0hUQ4DuY91OjcJSyHI6CyNDPZs4z2PM._L1XfNeGd58MuE5pKRq YdKgjTxHzWkc4f2V.zmK8Tccav77R_4w56bg- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sun, 27 Sep 2015 17:17:45 +1000 Message-Id: <1443338265-2950-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1442542649-22435-1-git-send-email-t_arceri@yahoo.com.au> References: <1442542649-22435-1-git-send-email-t_arceri@yahoo.com.au> Subject: [Piglit] [PATCH V2] arb_arrays_of_arrays: add some simple ubo AoA 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:c03::231 as permitted sender) smtp.mailfrom=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 V2: fix constant index test now that Mesa layout bug fixed, add mix const/non-const test --- .../execution/ubo/fs-const.shader_test | 41 ++++++++++++ .../ubo/fs-mixed-const-nonconst.shader_test | 67 +++++++++++++++++++ .../execution/ubo/fs-nonconst.shader_test | 76 ++++++++++++++++++++++ 3 files changed, 184 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/execution/ubo/fs-const.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/ubo/fs-mixed-const-nonconst.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/ubo/fs-nonconst.shader_test diff --git a/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-const.shader_test b/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-const.shader_test new file mode 100644 index 0000000..81d48a0 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-const.shader_test @@ -0,0 +1,41 @@ +# This test verifies that uniform indexing of UBO arrays in the +# fragment shader behaves correctly, when the block member is a +# const-indexed array. + +[require] +GLSL >= 1.50 +GL_ARB_arrays_of_arrays + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_arrays_of_arrays: require + +uniform block { + vec4 color[2]; +} arr[4][2]; + +uniform int n; + +out vec4 color; + +void main() +{ + color = arr[3][0].color[1] + arr[1][1].color[0]; +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +ubo array index 3 +uniform vec4 block.color[0] 0.0 1.0 0.0 0.0 +uniform vec4 block.color[1] 1.0 0.0 0.0 0.0 + +ubo array index 6 +uniform vec4 block.color[0] 1.0 0.0 0.0 0.0 +uniform vec4 block.color[1] 0.0 0.0 1.0 0.0 + +draw rect -1 -1 1 1 +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (0.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-mixed-const-nonconst.shader_test b/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-mixed-const-nonconst.shader_test new file mode 100644 index 0000000..a3523ca --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-mixed-const-nonconst.shader_test @@ -0,0 +1,67 @@ +# This test verifies that dynamically uniform indexing of UBO arrays +# in the fragment shader behaves correctly, when the block member is a +# nonconst-indexed array. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 +GL_ARB_arrays_of_arrays + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require +#extension GL_ARB_arrays_of_arrays: require + +uniform block { + vec4 color[2]; +} arr[3][2]; + +uniform int n; +uniform int m; + +out vec4 color; + +void main() +{ + color = arr[n][1].color[m]; +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +ubo array index 1 +uniform vec4 block.color[0] 1.0 0.0 0.0 0.0 +uniform vec4 block.color[1] 0.0 1.0 1.0 0.0 +ubo array index 3 +uniform vec4 block.color[0] 0.0 1.0 1.0 0.0 +uniform vec4 block.color[1] 0.0 1.0 0.0 0.0 +ubo array index 5 +uniform vec4 block.color[0] 0.0 0.0 1.0 0.0 +uniform vec4 block.color[1] 1.0 1.0 1.0 0.0 + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 1 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 2 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 2 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) diff --git a/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-nonconst.shader_test b/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-nonconst.shader_test new file mode 100644 index 0000000..be90ee7 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-nonconst.shader_test @@ -0,0 +1,76 @@ +# This test verifies that dynamically uniform indexing of UBO arrays +# in the fragment shader behaves correctly, when the block member is a +# nonconst-indexed array. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 +GL_ARB_arrays_of_arrays + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require +#extension GL_ARB_arrays_of_arrays: require + +uniform block { + vec4 color[2]; +} arr[3][2]; + +uniform int n; +uniform int m; + +out vec4 color; + +void main() +{ + color = arr[n][m].color[m]; +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +ubo array index 0 +uniform vec4 block.color[0] 1.0 0.0 0.0 0.0 +uniform vec4 block.color[1] 0.0 1.0 1.0 0.0 +ubo array index 1 +uniform vec4 block.color[0] 0.0 1.0 1.0 0.0 +uniform vec4 block.color[1] 0.0 1.0 0.0 0.0 +ubo array index 2 +uniform vec4 block.color[0] 0.0 0.0 1.0 0.0 +uniform vec4 block.color[1] 0.0 1.0 1.0 0.0 +ubo array index 3 +uniform vec4 block.color[0] 0.0 1.0 1.0 0.0 +uniform vec4 block.color[1] 0.0 1.0 1.0 0.0 +ubo array index 4 +uniform vec4 block.color[0] 0.0 1.0 1.0 0.0 +uniform vec4 block.color[1] 0.0 1.0 1.0 0.0 +ubo array index 5 +uniform vec4 block.color[0] 0.0 1.0 1.0 0.0 +uniform vec4 block.color[1] 1.0 1.0 1.0 0.0 + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 0 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 2 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0)