From patchwork Wed Nov 19 04:06:13 2014 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: 41095 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0FF32241C9 for ; Wed, 19 Nov 2014 04:06:52 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e53sf164033eek.7 for ; Tue, 18 Nov 2014 20:06:50 -0800 (PST) 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:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:reply-to :content-type:content-transfer-encoding; bh=S6rCVwEE/qV5VJnllabGHb5JA8ohh9s4UYXmKlTncCg=; b=mvOkFfqDDNdN0B/0jtHfI7pdZOfkE+ckmsKeytsbIneZHp/GGvLdzR5G2Igiqxty9k BHqI1lZGJv1HnImKcz5c2dQgJR2PeHvPn0qdZRRPavBL0NjlFFb/jAnFIcOUE83+xveB zP19mXeB4SPy0Nhm6hoV95Gl7FiQ2gpNvuOnXwEULT0V/9LDhU3cacezUiYc63d1UGJi 2vJTd3I1MWtII5Ny1uy2tkrS5GZHTUW3Ujth0gaAiwWcRGRax6bHaG0r/ISNmWNQmdQj y+Gm7+8ZVwKbCT+ZVNwEZU/BOq04b/cX4C5xixCU20Pkngw3qkqVv22YtjcT/Z7HQrTz yu6w== X-Gm-Message-State: ALoCoQls83PRI8yGA9PCNsjVc7H6gefp1rjT7ytyo38hojIGwsXqxQzYqabDxz9lZZR3Nfr9mAv9 X-Received: by 10.180.19.226 with SMTP id i2mr6602249wie.5.1416370010914; Tue, 18 Nov 2014 20:06:50 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.129 with SMTP id w1ls1314471lal.34.gmail; Tue, 18 Nov 2014 20:06:50 -0800 (PST) X-Received: by 10.152.87.18 with SMTP id t18mr40235635laz.0.1416370010681; Tue, 18 Nov 2014 20:06:50 -0800 (PST) Received: from mail-lb0-x22d.google.com (mail-lb0-x22d.google.com. [2a00:1450:4010:c04::22d]) by mx.google.com with ESMTPS id y2si457441lbo.100.2014.11.18.20.06.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Nov 2014 20:06:50 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22d as permitted sender) client-ip=2a00:1450:4010:c04::22d; Received: by mail-lb0-f173.google.com with SMTP id n15so18613475lbi.4 for ; Tue, 18 Nov 2014 20:06:50 -0800 (PST) X-Received: by 10.152.243.37 with SMTP id wv5mr36315687lac.10.1416370010496; Tue, 18 Nov 2014 20:06:50 -0800 (PST) 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.184.201 with SMTP id ew9csp22907lbc; Tue, 18 Nov 2014 20:06:48 -0800 (PST) X-Received: by 10.70.129.104 with SMTP id nv8mr41956674pdb.81.1416370007995; Tue, 18 Nov 2014 20:06:47 -0800 (PST) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id ps5si609659pac.221.2014.11.18.20.06.47 for ; Tue, 18 Nov 2014 20:06:47 -0800 (PST) Received-SPF: none (google.com: piglit-bounces@lists.freedesktop.org does not designate permitted sender hosts) client-ip=131.252.210.177; Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0EFA66E7A0; Tue, 18 Nov 2014 20:06:47 -0800 (PST) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm27-vm6.bullet.mail.gq1.yahoo.com (nm27-vm6.bullet.mail.gq1.yahoo.com [98.136.216.149]) by gabe.freedesktop.org (Postfix) with ESMTP id 81E016E7A5 for ; Tue, 18 Nov 2014 20:06:45 -0800 (PST) Received: from [216.39.60.181] by nm27.bullet.mail.gq1.yahoo.com with NNFMP; 19 Nov 2014 04:06:44 -0000 Received: from [98.136.164.64] by tm17.bullet.mail.gq1.yahoo.com with NNFMP; 19 Nov 2014 04:06:44 -0000 Received: from [127.0.0.1] by smtp226.mail.gq1.yahoo.com with NNFMP; 19 Nov 2014 04:06:44 -0000 X-Yahoo-Newman-Id: 882614.90451.bm@smtp226.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: wHUSUTcVM1l5_j6p0.jUCSf1l.B4zQzY7jWhkey9ET4f407 J7d03xElP1e4vjO_YYyvJRwJSis54j_WjsNnYcEp179F.f1FD0hZPSk53szE yDCniKAC6spurzFSR5TkhE_nzjrqqyRuRHGDpggsxOWkCcQof1_uls7RmfuX zW17rOwLgKz3Rg69vQZyD6G7OgfTOYX6lxNWTMpiG0wsYCRgfqtClKk52.6f L1cI7nZ58aCO9BFNIOiPuPOSWffcQ.EUGubMBVKN852iY5ULMsMZrUzkVaoJ 9_GIZMFeTmxP98R4j6WK_98nBVv7LfLtx25Y4q7UtC7AvqUfh9I3MvgjJYKl t5Z9g3FTZj_gzkAXUrUb8AG58fOFjCh7lRrz5BLKcLyWRdB1RKfXtO9qet71 peAVBlEBl5N6.7enejADhwyWww5ok.cjtR7CYIbNxdep4AkzjcUphiJhe90l uO9INItnAXxvE8w0DBElmM5eGuP7KlNDUpjtd0n.freKkOqvUl3U44LYCD1Z R9Iv7HibUE7.YuqcOYPkodMQuX9IRugcr0MTlBFgvDVj6eFNqPTlK9sD3qrK 96bJbIhQ6YqL__00njs8O2G3GsxqLXh_c6KHpvddnbbQHkPZZK5PRxHi3wYD h_hl59C4B1NW1OP0jMDGmA1XH X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Wed, 19 Nov 2014 15:06:13 +1100 Message-Id: <1416369973-8016-2-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1416369973-8016-1-git-send-email-t_arceri@yahoo.com.au> References: <1416369973-8016-1-git-send-email-t_arceri@yahoo.com.au> Subject: [Piglit] [PATCH V2 2/2] arb_arrays_of_arrays: geometry shader 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::22d as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; 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: Added Nvidia results to commit message Test results are from the following hardware/driver combination: AMD Radeon HD 6670 - Catalyst 13.251 OpenGL 4.3 Nvidia Geforce GTX 570 - 340.24 OpenGL 4.4 The Nvidia results do not always mean what they are intended to (e.g. passing for the wrong reason) as the driver doesn't allow multi dimensional arrays of interface blocks even though the spec says they are allowed. I've indicated these tests with a * gs-input-sizing-consistent-with-prev-length-blocks.geom AMD: pass Nvidia: fail* gs-input-sizing-consistent-with-prev-length.geom AMD: pass Nvidia: pass gs-input-sizing-implied-length-blocks.geom AMD: pass Nvidia: fail gs-input-sizing-implied-length-consistent-with-prev-usage-blocks.geom AMD: pass Nvidia: fail* gs-input-sizing-implied-length-consistent-with-prev-usage.geom AMD: pass Nvidia: pass gs-input-sizing-implied-length-inconsistent-with-prev-usage-blocks.geom AMD: fail Nvidia: pass* gs-input-sizing-implied-length-inconsistent-with-prev-usage.geom AMD: fail Nvidia: fail gs-input-sizing-implied-length.geom AMD: pass Nvidia: fail gs-input-sizing-inconsistent-blocks-invalid.geom AMD: fail Nvidia: pass* gs-input-sizing-inconsistent-blocks-valid.geom AMD: pass Nvidia: fail* gs-input-sizing-inconsistent-invalid.geom AMD: fail Nvidia: pass gs-input-sizing-inconsistent-valid.geom AMD: pass Nvidia: pass gs-output.geom AMD: pass Nvidia: fail* gs-redeclares-pervertex-in-as-array-of-arrays.geom AMD: fail Nvidia: pass* gs-redeclares-pervertex-in-as-array-of-arrays2.geom AMD: fail Nvidia: pass* Signed-off-by: Timothy Arceri Reviewed-by: Chris Forbes --- This is a resend of a patch from July Can be tested on mesa using this branch: https://github.com/tarceri/Mesa_arrays_of_arrays/tree/linking3 These geom shader tests are mainly just tests taken from the glsl 1.50 compile tests and extended for arrays of arrays. I've made some assumptions where the spec doesn't provide full detail. As you can see from the results the Nvidia and AMD drivers do not always follow the spec even when it does provide full detail. ...-sizing-consistent-with-prev-length-blocks.geom | 40 +++++++++++++++++++ ...s-input-sizing-consistent-with-prev-length.geom | 33 ++++++++++++++++ .../gs-input-sizing-implied-length-blocks.geom | 31 +++++++++++++++ ...d-length-consistent-with-prev-usage-blocks.geom | 41 ++++++++++++++++++++ ...-implied-length-consistent-with-prev-usage.geom | 38 ++++++++++++++++++ ...length-inconsistent-with-prev-usage-blocks.geom | 41 ++++++++++++++++++++ ...mplied-length-inconsistent-with-prev-usage.geom | 38 ++++++++++++++++++ .../compiler/gs-input-sizing-implied-length.geom | 27 +++++++++++++ ...s-input-sizing-inconsistent-blocks-invalid.geom | 37 ++++++++++++++++++ .../gs-input-sizing-inconsistent-blocks-valid.geom | 21 ++++++++++ .../gs-input-sizing-inconsistent-invalid.geom | 31 +++++++++++++++ .../gs-input-sizing-inconsistent-valid.geom | 16 ++++++++ .../arb_arrays_of_arrays/compiler/gs-output.geom | 28 ++++++++++++++ ...redeclares-pervertex-in-as-array-of-arrays.geom | 45 ++++++++++++++++++++++ ...edeclares-pervertex-in-as-array-of-arrays2.geom | 45 ++++++++++++++++++++++ 15 files changed, 512 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length-blocks.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-blocks.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage-blocks.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage-blocks.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-invalid.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-valid.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-invalid.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-valid.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-output.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays2.geom diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length-blocks.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length-blocks.geom new file mode 100644 index 0000000..fb2fcff --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length-blocks.geom @@ -0,0 +1,40 @@ +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec +// includes the following examples of compile-time errors: +// +// // code sequence within one shader... +// in vec4 Color1[]; // size unknown +// ...Color1.length()...// illegal, length() unknown +// in vec4 Color2[2]; // size is 2 +// ...Color1.length()...// illegal, Color1 still has no size +// in vec4 Color3[3]; // illegal, input sizes are inconsistent +// layout(lines) in; // legal, input size is 2, matching (*) +// in vec4 Color4[3]; // illegal, contradicts layout +// ...Color1.length()...// legal, length() is 2, Color1 sized by layout() +// layout(lines) in; // legal, matches other layout() declaration +// layout(triangles) in;// illegal, does not match earlier layout() declaration +// +// This test verifies the case marked with (*), namely that no error +// results from declaring a geometry shader input layout after +// declaraing geometry shader inputs that are either unsized or have a +// size consistent with the declared layout. This test verifies the +// case for input interface blocks. +// +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in blk1 { + vec4 Color; +} inst1[][2]; + +in blk2 { + vec4 Color; +} inst2[2][2]; + +layout(lines) in; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length.geom new file mode 100644 index 0000000..c0e7b65 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length.geom @@ -0,0 +1,33 @@ +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec +// includes the following examples of compile-time errors: +// +// // code sequence within one shader... +// in vec4 Color1[]; // size unknown +// ...Color1.length()...// illegal, length() unknown +// in vec4 Color2[2]; // size is 2 +// ...Color1.length()...// illegal, Color1 still has no size +// in vec4 Color3[3]; // illegal, input sizes are inconsistent +// layout(lines) in; // legal, input size is 2, matching (*) +// in vec4 Color4[3]; // illegal, contradicts layout +// ...Color1.length()...// legal, length() is 2, Color1 sized by layout() +// layout(lines) in; // legal, matches other layout() declaration +// layout(triangles) in;// illegal, does not match earlier layout() declaration +// +// This test verifies the case marked with (*), namely that no error +// results from declaring a geometry shader input layout after +// declaraing geometry shader inputs that are either unsized or have a +// size consistent with the declared layout. +// +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in vec4 Color1[][4]; +in vec4 Color2[2][4]; +layout(lines) in; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-blocks.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-blocks.geom new file mode 100644 index 0000000..d35a480 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-blocks.geom @@ -0,0 +1,31 @@ +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec says: +// +// All geometry shader input unsized array declarations will be +// sized by an earlier input layout qualifier, when present, as per +// the following table. +// +// Followed by a table mapping each allowed input layout qualifier to +// the corresponding input length. +// +// This test verifies that if an unsized array declaration follows an +// input layout qualifier, the size is implied. This test verifies +// the case for input interface blocks. +// +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +layout(lines) in; + +in blk { + vec4 Color; +} inst[][3]; + +uniform int foo[inst.length() == 2 ? 1 : -1]; +uniform int foo2[inst[1].length() == 3 ? 1 : -1]; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage-blocks.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage-blocks.geom new file mode 100644 index 0000000..2f9c578 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage-blocks.geom @@ -0,0 +1,41 @@ +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec +// includes the following examples of compile-time errors: +// +// // code sequence within one shader... +// in vec4 Color1[]; // size unknown +// ...Color1.length()...// illegal, length() unknown +// in vec4 Color2[2]; // size is 2 +// ...Color1.length()...// illegal, Color1 still has no size +// in vec4 Color3[3]; // illegal, input sizes are inconsistent +// layout(lines) in; // legal, input size is 2, matching +// in vec4 Color4[3]; // illegal, contradicts layout +// ...Color1.length()...// legal, length() is 2, Color1 sized by layout() +// layout(lines) in; // legal, matches other layout() declaration +// layout(triangles) in;// illegal, does not match earlier layout() declaration +// +// This test verifies that when a layout declaration causes a +// previously unsized geometry shader input array to become sized, if +// an intervening usage of that input array was consistent with the +// new size, there is no error. This test verifies the case for input +// interface blocks. +// +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in blk { + vec4 Color; +} inst[][6]; + +vec4 foo() +{ + return inst[2][4].Color; +} + +layout(triangles) in; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage.geom new file mode 100644 index 0000000..76d54dc --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage.geom @@ -0,0 +1,38 @@ +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec +// includes the following examples of compile-time errors: +// +// // code sequence within one shader... +// in vec4 Color1[]; // size unknown +// ...Color1.length()...// illegal, length() unknown +// in vec4 Color2[2]; // size is 2 +// ...Color1.length()...// illegal, Color1 still has no size +// in vec4 Color3[3]; // illegal, input sizes are inconsistent +// layout(lines) in; // legal, input size is 2, matching +// in vec4 Color4[3]; // illegal, contradicts layout +// ...Color1.length()...// legal, length() is 2, Color1 sized by layout() +// layout(lines) in; // legal, matches other layout() declaration +// layout(triangles) in;// illegal, does not match earlier layout() declaration +// +// This test verifies that when a layout declaration causes a +// previously unsized geometry shader input array to become sized, if +// an intervening usage of that input array was consistent with the +// new size, there is no error. +// +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in vec4 Color[][4]; + +vec4 foo() +{ + return Color[2][3]; +} + +layout(triangles) in; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage-blocks.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage-blocks.geom new file mode 100644 index 0000000..9e9cde3 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage-blocks.geom @@ -0,0 +1,41 @@ +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec +// includes the following examples of compile-time errors: +// +// // code sequence within one shader... +// in vec4 Color1[]; // size unknown +// ...Color1.length()...// illegal, length() unknown +// in vec4 Color2[2]; // size is 2 +// ...Color1.length()...// illegal, Color1 still has no size +// in vec4 Color3[3]; // illegal, input sizes are inconsistent +// layout(lines) in; // legal, input size is 2, matching +// in vec4 Color4[3]; // illegal, contradicts layout +// ...Color1.length()...// legal, length() is 2, Color1 sized by layout() +// layout(lines) in; // legal, matches other layout() declaration +// layout(triangles) in;// illegal, does not match earlier layout() declaration +// +// This test verifies that when a layout declaration causes a +// previously unsized geometry shader input array to become sized, if +// an intervening usage of that input array wasn't consistent with the +// new size, there is an error. This test verifies the case for input +// interface blocks. +// +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in blk { + vec4 Color; +} inst[][2]; + +vec4 foo() +{ + return inst[2][1].Color; +} + +layout(lines) in; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage.geom new file mode 100644 index 0000000..14cb773 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage.geom @@ -0,0 +1,38 @@ +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec +// includes the following examples of compile-time errors: +// +// // code sequence within one shader... +// in vec4 Color1[]; // size unknown +// ...Color1.length()...// illegal, length() unknown +// in vec4 Color2[2]; // size is 2 +// ...Color1.length()...// illegal, Color1 still has no size +// in vec4 Color3[3]; // illegal, input sizes are inconsistent +// layout(lines) in; // legal, input size is 2, matching +// in vec4 Color4[3]; // illegal, contradicts layout +// ...Color1.length()...// legal, length() is 2, Color1 sized by layout() +// layout(lines) in; // legal, matches other layout() declaration +// layout(triangles) in;// illegal, does not match earlier layout() declaration +// +// This test verifies that when a layout declaration causes a +// previously unsized geometry shader input array to become sized, if +// an intervening usage of that input array wasn't consistent with the +// new size, there is an error. +// +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in vec4 Color[][2]; + +vec4 foo() +{ + return Color[2][1]; +} + +layout(lines) in; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length.geom new file mode 100644 index 0000000..cc8c022 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length.geom @@ -0,0 +1,27 @@ +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec says: +// +// All geometry shader input unsized array declarations will be +// sized by an earlier input layout qualifier, when present, as per +// the following table. +// +// Followed by a table mapping each allowed input layout qualifier to +// the corresponding input length. +// +// This test verifies that if an unsized array declaration follows an +// input layout qualifier, the size is implied. +// +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +layout(lines) in; +in vec4 Color[][3]; + +uniform int foo[Color.length() == 2 ? 1 : -1]; +uniform int foo2[Color[1].length() == 3 ? 1 : -1]; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-invalid.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-invalid.geom new file mode 100644 index 0000000..4485c4f --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-invalid.geom @@ -0,0 +1,37 @@ +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec +// includes the following examples of compile-time errors: +// +// // code sequence within one shader... +// in vec4 Color1[]; // size unknown +// ...Color1.length()...// illegal, length() unknown +// in vec4 Color2[2]; // size is 2 +// ...Color1.length()...// illegal, Color1 still has no size +// in vec4 Color3[3]; // illegal, input sizes are inconsistent (*) +// layout(lines) in; // legal, input size is 2, matching +// in vec4 Color4[3]; // illegal, contradicts layout +// ...Color1.length()...// legal, length() is 2, Color1 sized by layout() +// layout(lines) in; // legal, matches other layout() declaration +// layout(triangles) in;// illegal, does not match earlier layout() declaration +// +// This test verifies the case marked with (*), namely that declaring +// two geometry shader inputs with different array sizes (for the outer most +// dimension) causes a compile error. +// This test verifies the case for input interface blocks. +// +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in blk1 { + vec4 Color; +} inst2[2][6]; + +in blk2 { + vec4 Color; +} inst3[3][6]; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-valid.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-valid.geom new file mode 100644 index 0000000..909b347 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-valid.geom @@ -0,0 +1,21 @@ +// This test verifies that declaring +// two geometry shader inputs with different array sizes only causes a +// compile error when the outer most dimension differs. +// +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in blk1 { + vec4 Color; +} inst2[2][4]; + +in blk2 { + vec4 Color; +} inst3[2][5]; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-invalid.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-invalid.geom new file mode 100644 index 0000000..f2a55dc --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-invalid.geom @@ -0,0 +1,31 @@ +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec +// includes the following examples of compile-time errors: +// +// // code sequence within one shader... +// in vec4 Color1[]; // size unknown +// ...Color1.length()...// illegal, length() unknown +// in vec4 Color2[2]; // size is 2 +// ...Color1.length()...// illegal, Color1 still has no size +// in vec4 Color3[3]; // illegal, input sizes are inconsistent (*) +// layout(lines) in; // legal, input size is 2, matching +// in vec4 Color4[3]; // illegal, contradicts layout +// ...Color1.length()...// legal, length() is 2, Color1 sized by layout() +// layout(lines) in; // legal, matches other layout() declaration +// layout(triangles) in;// illegal, does not match earlier layout() declaration +// +// This test verifies the case marked with (*), namely that declaring +// two geometry shader inputs with different array sizes (for the outer most +// dimension) causes a compile error. +// +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in vec4 Color2[2][5]; +in vec4 Color3[3][5]; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-valid.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-valid.geom new file mode 100644 index 0000000..2590af3 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-valid.geom @@ -0,0 +1,16 @@ +// This test verifies that declaring +// two geometry shader inputs with different array sizes only causes a +// compile error when the outer most dimension differs. +// +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in vec4 Color2[2][4]; +in vec4 Color3[2][3]; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-output.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-output.geom new file mode 100644 index 0000000..3bb74bf --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-output.geom @@ -0,0 +1,28 @@ +// Verify that geometry shader output arrays of arrays can be declared. +// +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +layout(triangles) in; + +in vec4 v1[3]; + +out vec4 v2[2][4]; +out blk1 { + out vec4 v3[2][1]; +}; +out blk2 { + out vec4 v[2][5]; +} ifc1; +out blk3 { + out vec4 v; +} ifc2[2][3]; +out vec4[3] v4[4]; +out vec4[2][3] v5; diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays.geom new file mode 100644 index 0000000..3b9c2ac --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays.geom @@ -0,0 +1,45 @@ +// From section 7.1.1 (Compatibility Profile Built-In Language +// Variables) of the GLSL 4.10 spec: +// +// However, when a built-in interface block with an instance name +// is redeclared (e.g., gl_in), the instance name must be included +// in the redeclaration. It is an error to not include the +// built-in instance name or to change its name. For example, +// +// in gl_PerVertex { +// vec4 gl_ClipVertex; +// vec4 gl_FrontColor; +// } gl_in[]; // must be present and must be "gl_in[]" +// +// Note: although this text appears in a section referring to +// compatibility profile variables, it's clear from context that it's +// meant to apply to any redeclaration of gl_in, whether it is done in +// a compatibility or a core profile. +// +// This appears to be a clarification to the behaviour established for +// gl_PerVertex by GLSL 1.50, therefore we test it using GLSL version +// 1.50. +// +// In this test, we try redeclaraing the gl_PerVertex input as an +// array of arrays. +// +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +layout(triangles) in; +layout(triangle_strip, max_vertices = 3) out; + +in gl_PerVertex { + vec4 gl_Position; +} gl_in[][6]; + +void main() +{ +} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays2.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays2.geom new file mode 100644 index 0000000..6e56703 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays2.geom @@ -0,0 +1,45 @@ +// From section 7.1.1 (Compatibility Profile Built-In Language +// Variables) of the GLSL 4.10 spec: +// +// However, when a built-in interface block with an instance name +// is redeclared (e.g., gl_in), the instance name must be included +// in the redeclaration. It is an error to not include the +// built-in instance name or to change its name. For example, +// +// in gl_PerVertex { +// vec4 gl_ClipVertex; +// vec4 gl_FrontColor; +// } gl_in[]; // must be present and must be "gl_in[]" +// +// Note: although this text appears in a section referring to +// compatibility profile variables, it's clear from context that it's +// meant to apply to any redeclaration of gl_in, whether it is done in +// a compatibility or a core profile. +// +// This appears to be a clarification to the behaviour established for +// gl_PerVertex by GLSL 1.50, therefore we test it using GLSL version +// 1.50. +// +// In this test, we try redeclaraing the gl_PerVertex input as an +// array of arrays. +// +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_arrays_of_arrays +// check_link: false +// [end config] + +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +layout(triangles) in; +layout(triangle_strip, max_vertices = 3) out; + +in gl_PerVertex { + vec4 gl_Position; +} gl_in[3][6]; + +void main() +{ +}