From patchwork Fri Sep 18 02:17:29 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: 53856 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 E361F22A0D for ; Fri, 18 Sep 2015 02:17:47 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf3804665wic.1 for ; Thu, 17 Sep 2015 19:17:47 -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=ferxPmcwAEyptqw5rnvr6ntJPtuykgH6dogpLEzc6x8=; b=YM1yUSHzw5BRTqWDIRvVExZ8oKTYOCwdHqWcAc0ZisrP3Gf4h1E20wrKOulnaPj3bL 2qLB+rtvxy7T1GDBmqDQ3Voa3hH0eOQhjV+Ur1qMvG23Fl80LlFwOodR1ROcEF+n6hMT IeJz9ZqAOx//vZtPCwliN39efDGVRRIaMTE/4s3bcaLlzqcZ45pLE9/DgG7Qn5V1C9jj lHB7QXnN0dxtfiJxyaao1cuz0cROqWZb8hguJMPpF6dJFre2MrSO2JMqbYECGYW4d4tN zczEfODJSRPnz8chhEz9tYqLFzo+vd94Gc42vdkOE0aS60oroPQtx2Cs1BWOeg0dv3EU zvsQ== X-Gm-Message-State: ALoCoQkl6zBuCUM7e86mxyRI0Pf/F+ObccA2SHmb2kumakgG0wkraE4mpF76hiaV3OzhanhNRN/u X-Received: by 10.152.29.10 with SMTP id f10mr390105lah.1.1442542667168; Thu, 17 Sep 2015 19:17:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.168 with SMTP id f8ls167334lam.50.gmail; Thu, 17 Sep 2015 19:17:46 -0700 (PDT) X-Received: by 10.25.21.79 with SMTP id l76mr15091lfi.79.1442542666967; Thu, 17 Sep 2015 19:17:46 -0700 (PDT) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com. [2a00:1450:4010:c03::235]) by mx.google.com with ESMTPS id ap9si4333009lac.87.2015.09.17.19.17.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 19:17:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::235 as permitted sender) client-ip=2a00:1450:4010:c03::235; Received: by lanb10 with SMTP id b10so22085550lan.3 for ; Thu, 17 Sep 2015 19:17:46 -0700 (PDT) X-Received: by 10.152.26.41 with SMTP id i9mr2077454lag.36.1442542666618; Thu, 17 Sep 2015 19:17:46 -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 w3csp21326lbq; Thu, 17 Sep 2015 19:17:45 -0700 (PDT) X-Received: by 10.66.121.229 with SMTP id ln5mr4078029pab.133.1442542665605; Thu, 17 Sep 2015 19:17:45 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id d10si9605051pas.77.2015.09.17.19.17.45; Thu, 17 Sep 2015 19:17:45 -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 D21136E4E4; Thu, 17 Sep 2015 19:17:44 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm23-vm4.bullet.mail.gq1.yahoo.com (nm23-vm4.bullet.mail.gq1.yahoo.com [98.136.217.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4E5EB6E4E4 for ; Thu, 17 Sep 2015 19:17:42 -0700 (PDT) Received: from [98.137.12.190] by nm23.bullet.mail.gq1.yahoo.com with NNFMP; 18 Sep 2015 02:17:42 -0000 Received: from [98.136.164.74] by tm11.bullet.mail.gq1.yahoo.com with NNFMP; 18 Sep 2015 02:17:42 -0000 Received: from [127.0.0.1] by smtp236.mail.gq1.yahoo.com with NNFMP; 18 Sep 2015 02:17:42 -0000 X-Yahoo-Newman-Id: 340029.68743.bm@smtp236.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: GfzrsZcVM1kBNV.pyjmT9j8GnJ1RYYOW7Z6eG7WDpJyFYhk 2UnKAP.LQAMmo5GQj0RYmapYTFBWxxmM_6w51.qw.XTJgbWNBY3atwa3_DCq ffCi1VCR521NOVwV37uIsYLhQshzBCXU_nsO2iFic8hElaaQVwDzG2SR_d3T nPyIEtJFLsDlaaVuJ.sFF5cBclfDsOS7F2CTfOLDTI59iKzO8lJL6dmuhDsc FYI00YWpyumUJnOaKSy.QXiQW3HuGVyZmbJEoO55WmTXBx5wcD6CEZPjpqlv hYu8eJDGd035hUWOYVXGYuZfmf_adAqtf2zH.zfyhqlO_tDG8fb02_AsycxU 530Ya595JkqvV_8WgC.UpWqSmKbHPC1sgVlGdFTpSrW1YxcN388JYyVZBxIL nr2pRodVSe6BFf6j15nIV3NZ5gJ3ySr4Tz3WHrWMJebzbg5BGIAtrM_9.6Bs Qeexecrtaexzxq7Y8iWgPeCoHkw1etBNdJJ9vYH5D3VOSBlnT1K53UiMZafW H.9wIADW1kR2YNKD1M1tJnRAt_fcth45Qv.0- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Fri, 18 Sep 2015 12:17:29 +1000 Message-Id: <1442542649-22435-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 Subject: [Piglit] [PATCH] 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::235 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 --- .../execution/ubo/fs-const.shader_test | 37 +++++++++++ .../execution/ubo/fs-nonconst.shader_test | 76 ++++++++++++++++++++++ 2 files changed, 113 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-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..7757ad4 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-const.shader_test @@ -0,0 +1,37 @@ +# 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]; +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +ubo array index 0 +uniform vec4 block.color[0] 0.0 0.0 1.0 0.0 +uniform vec4 block.color[1] 1.0 0.0 0.0 0.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) 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)