From patchwork Thu Aug 27 03:21:28 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: 52752 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 5B7B222E8B for ; Thu, 27 Aug 2015 03:21:42 +0000 (UTC) Received: by labth1 with SMTP id th1sf2161876lab.2 for ; Wed, 26 Aug 2015 20:21:41 -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=DToUnNemQXpM21mMH6w0H6gmGyyQNjvto2lkZJ49cbg=; b=PrdoYqoF/VPoF/63maImRiOVS6DcqVsmQ2cXIth6Rmdlzfb0ou+Mfuo1W9SjsvgGAa VmIjpugrRItQzlkkhdB3Uuu8tn+jMNsItu0b42y7UMhmdfI/m1UelZzYBDMDMDE3xf9V LOFV47XULGEcwRHvJ2rvlp+jv4gCgeJVO4NJjy6DVtWU+1OGeRjALxmqnfrVy+s4R2Cg 6n2EiQriEZlbouB1PuErURpX0OWI/C3GMrR/Vqrayklr/dM8Y3vlWVhpW2TpbPGcAfSB rLUywqwVETOxybIk8iAuUXz8mluGDz6hdQAEKsmhk52AE2SQz75LRzSsAybCxLym+tn8 A91w== X-Gm-Message-State: ALoCoQkTDggIUoEJz6ze7XQG76SF1JhZD+AnXXi+u69RAq7fqXpBAtrXj38qb6/7iYXH8xtt5LJj X-Received: by 10.194.173.3 with SMTP id bg3mr462625wjc.5.1440645701278; Wed, 26 Aug 2015 20:21:41 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.2 with SMTP id i2ls34166laf.100.gmail; Wed, 26 Aug 2015 20:21:41 -0700 (PDT) X-Received: by 10.112.205.6 with SMTP id lc6mr1012986lbc.95.1440645701035; Wed, 26 Aug 2015 20:21:41 -0700 (PDT) Received: from mail-lb0-x233.google.com (mail-lb0-x233.google.com. [2a00:1450:4010:c04::233]) by mx.google.com with ESMTPS id y12si708032lbm.75.2015.08.26.20.21.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2015 20:21:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::233 as permitted sender) client-ip=2a00:1450:4010:c04::233; Received: by lbbsx3 with SMTP id sx3so3527302lbb.0 for ; Wed, 26 Aug 2015 20:21:40 -0700 (PDT) X-Received: by 10.112.166.2 with SMTP id zc2mr1038897lbb.29.1440645700846; Wed, 26 Aug 2015 20:21:40 -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.162.200 with SMTP id yc8csp4335708lbb; Wed, 26 Aug 2015 20:21:39 -0700 (PDT) X-Received: by 10.68.168.161 with SMTP id zx1mr3104908pbb.35.1440645698893; Wed, 26 Aug 2015 20:21:38 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id d1si1205860pdh.123.2015.08.26.20.21.38; Wed, 26 Aug 2015 20:21:38 -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 BC3896E77D; Wed, 26 Aug 2015 20:21:37 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm14-vm6.bullet.mail.gq1.yahoo.com (nm14-vm6.bullet.mail.gq1.yahoo.com [98.136.218.78]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84E8C6E77D for ; Wed, 26 Aug 2015 20:21:36 -0700 (PDT) Received: from [98.137.12.63] by nm14.bullet.mail.gq1.yahoo.com with NNFMP; 27 Aug 2015 03:21:35 -0000 Received: from [98.136.164.75] by tm8.bullet.mail.gq1.yahoo.com with NNFMP; 27 Aug 2015 03:21:35 -0000 Received: from [127.0.0.1] by smtp237.mail.gq1.yahoo.com with NNFMP; 27 Aug 2015 03:21:35 -0000 X-Yahoo-Newman-Id: 524611.30592.bm@smtp237.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: tpUZczcVM1mpIE7gd0uaTWI7H4BZVIS5JQMMIjxSyREl6Pj uhC_wBh7mVfyLDwtQef2IyOLWmruHsdBlcYhjkbPp8DakOQjtf9Mdm46GOKO laxI5Gy2G7j3ELvRX98yF5CSFIZeksULiUy9Eb42Mx1p0Dvr5DFpuS61LJfZ ExGKYhMVx9sA_3vc6NjYaTIXHIVCyG39VPCRoDtObKmtlI6PCDdVe2FPxQrO 3SxXh0isdHMMbxbZAUnjgwWMLIU3P3bo988bphbOTadsu_WfFqbOobDBBVH9 bLGPI6x2f659tkBcSteHCXJQ1GYaxjbfRoA.5bIgpzD3rs.ZFkozDr7VnUb. oLkxENyZeIEqO2llVasJ.TUnwgnL3P_nvyntGyPYsnMPZ7yYyWe441fbjg_O 7usLLUkMFewe3uz9sdDXx3UV.xRGiHycsbUa_w2BqyQjcPRUom6TZk8Ou3G8 bnmnSHHF_Pwj0cz1Z7kILW85euRYOZnUPfft6fyMvSa.m.yR7czXqgcmVR9M F7keG7V1D8H9ekugZ59CDHLZJNUEUe4_0JlU- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Thu, 27 Aug 2015 13:21:28 +1000 Message-Id: <1440645688-25800-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 Subject: [Piglit] [PATCH] arb_gpu_shader5: add more complex structs with samplers 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::233 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 When there is more that one sampler inside a struct Mesa doesn't currently order the sampler indexs internally in a way that is usable for indirect indexing. These tests expose the currently missing functionality in Mesa. Other test results: Nvidia GeForce 840M - NVIDIA 346.47: pass --- .../fs-nested-struct-arrays-nonconst.shader_test | 94 ++++++++++++++++++++++ ...s-struct-nonconst-multiple-samplers.shader_test | 79 ++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-nested-struct-arrays-nonconst.shader_test create mode 100644 tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-multiple-samplers.shader_test diff --git a/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-nested-struct-arrays-nonconst.shader_test b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-nested-struct-arrays-nonconst.shader_test new file mode 100644 index 0000000..2c99c08 --- /dev/null +++ b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-nested-struct-arrays-nonconst.shader_test @@ -0,0 +1,94 @@ +# This test verifies that dynamic uniform indexing of samplers within +# a nested struct array for the fragment shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +struct S_inner { + sampler2D tex; + sampler2D tex2; +}; + +struct S { + sampler2D tex; + S_inner si; +}; + +uniform S s[2]; + +uniform int n; +uniform int select; + +out vec4 color; + +void main() +{ + if (select == 0) + color = texture(s[n].tex, vec2(0.75, 0.25)); + else + color = texture(s[n].si.tex, vec2(0.75, 0.25)) + texture(s[n].si.tex2, vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0].tex 0 +uniform int s[1].tex 1 +uniform int s[0].si.tex 2 +uniform int s[1].si.tex 3 +uniform int s[0].si.tex2 4 +uniform int s[1].si.tex2 5 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 0.25, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.25, 0.25, 0.25, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 4 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 0.75, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 5 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.75, 0.75, 0.75, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int select 0 +uniform int n 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 +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 select 1 +uniform int n 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 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_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-multiple-samplers.shader_test b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-multiple-samplers.shader_test new file mode 100644 index 0000000..b717196 --- /dev/null +++ b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-struct-nonconst-multiple-samplers.shader_test @@ -0,0 +1,79 @@ +# This test verifies that dynamic uniform indexing of samplers inside +# a stuct array in the fragment shader behaves correctly. + +[require] +GLSL >= 1.50 +GL_ARB_gpu_shader5 + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_gpu_shader5: require + +struct S { + sampler2D tex; + sampler2D tex2; +}; + +uniform S s[2]; + +uniform int n; +uniform int select; + +out vec4 color; + +void main() +{ + if (select == 0) + color = texture(s[n].tex, vec2(0.75, 0.25)); + else + color = texture(s[n].tex2, vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +uniform int s[0].tex 0 +uniform int s[1].tex 1 +uniform int s[0].tex2 2 +uniform int s[1].tex2 3 + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest + +uniform int n 0 +uniform int select 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 +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 0 +uniform int select 1 +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 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)