From patchwork Wed Jul 16 06:20:33 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: 33702 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 65135201F1 for ; Wed, 16 Jul 2014 06:20:52 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf3382474pdb.1 for ; Tue, 15 Jul 2014 23:20:51 -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:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :reply-to:content-type:content-transfer-encoding; bh=iom5Qd6vKUDGWSdUXfxhExVzB9E+uShovm9lp/AZtXU=; b=RBu2Y+e4qD0SOWIlDkyYkXjNHjNET4y4XkESR43cCl8YlNRH3V2AvSR+/btao2GkPu tsJYPBDc4OOaVYu+e6KOWSewQjGy/YuCx3oka+UO39WVrux6HYbOVnFot4p8537yMiHU eZ3EL10u/fFifiCpDnWKng45LFi6b2Y9hPLj0uHUHUaoieX+ZUbXtYDN1kPHKIoKDzlZ qR1zD054qNYgtGWv2szLXzbEumHKFhgjU33Vw9+smFZ08SwAElDTHbKGOcH+dcAt4mvQ BXQO/KbTPzTwayDtYaVOSujUdVAFImDOOhfPDIKaauqWEtnPV+FKpstMQptto34JkyQT 2R1A== X-Gm-Message-State: ALoCoQkYy2Yq8ppSJpZNh4H+Xo0zxgWr+2OHAlQZ0BmeOzncUIZG0sDjwzM2BZPeYuxHBdgEc7Pu X-Received: by 10.66.231.68 with SMTP id te4mr13657734pac.29.1405491651433; Tue, 15 Jul 2014 23:20:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.18 with SMTP id v18ls309829qge.51.gmail; Tue, 15 Jul 2014 23:20:51 -0700 (PDT) X-Received: by 10.220.118.136 with SMTP id v8mr1312902vcq.50.1405491651330; Tue, 15 Jul 2014 23:20:51 -0700 (PDT) Received: from mail-vc0-x22f.google.com (mail-vc0-x22f.google.com [2607:f8b0:400c:c03::22f]) by mx.google.com with ESMTPS id t2si7842269vcs.89.2014.07.15.23.20.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jul 2014 23:20:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22f as permitted sender) client-ip=2607:f8b0:400c:c03::22f; Received: by mail-vc0-f175.google.com with SMTP id hu12so777837vcb.20 for ; Tue, 15 Jul 2014 23:20:51 -0700 (PDT) X-Received: by 10.220.44.141 with SMTP id a13mr80619vcf.71.1405491651208; Tue, 15 Jul 2014 23:20:51 -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.221.37.5 with SMTP id tc5csp271550vcb; Tue, 15 Jul 2014 23:20:49 -0700 (PDT) X-Received: by 10.68.106.194 with SMTP id gw2mr27657971pbb.85.1405491648284; Tue, 15 Jul 2014 23:20:48 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id g4si6819292pde.327.2014.07.15.23.20.47 for ; Tue, 15 Jul 2014 23:20:48 -0700 (PDT) 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 59D056E19D; Tue, 15 Jul 2014 23:20:47 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm30-vm6.bullet.mail.gq1.yahoo.com (nm30-vm6.bullet.mail.gq1.yahoo.com [98.136.216.197]) by gabe.freedesktop.org (Postfix) with ESMTP id C46176E19D for ; Tue, 15 Jul 2014 23:20:45 -0700 (PDT) Received: from [98.137.12.175] by nm30.bullet.mail.gq1.yahoo.com with NNFMP; 16 Jul 2014 06:20:44 -0000 Received: from [208.71.42.190] by tm14.bullet.mail.gq1.yahoo.com with NNFMP; 16 Jul 2014 06:20:44 -0000 Received: from [127.0.0.1] by smtp201.mail.gq1.yahoo.com with NNFMP; 16 Jul 2014 06:20:44 -0000 X-Yahoo-Newman-Id: 132414.9639.bm@smtp201.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: oJZ85kIVM1ltpGSGpiB8TO7Ply8exYCXpvsOav.f.KEqQQg 53p.gwkADMCAImpnLUXGEoZWAGjKA2pEH1N07DrfqcMkHa2cTBh7gGHCDy.h 3UUnWZryt_r_Bt.2SYSsWn5aaJqxBiTN5ZOVbqKotVhiBH2sh2dnAa90A5AD h9fZl6V0Mw.fwWFVOWjXtabxw.zXJTD7xNgF6I3Dp_aTnmdJqEqOhO7bfFCT pzylpJR4dzwCv2XkVGg_2JA3DtnWQRyA82R5y_ipQN1Kcz0mBV.GG5lk5Tze 4AJXgGLV4uf_3_0nEhjcgv8Wwa4n_dL8K1.n7Ek7gMWE.GwoABXvyebKDee1 S_vqfNJPoH6FiMLmsEmuKLpTygdquANObatVVFk2M6khe0XU7Qnh3R7B6lIx AXGH4gyVMCQNOFl8PBCZaC1F4PiTLAcEF.obKkA_mp4Fn1Izx3HhdS.ePLy1 YR7PQcPSvW1wOu5KTnAfslWW1pzOoetA4oNNBDFvXDpf7wLMKUrkgJgl6IQ6 hHm.NgpcDOx2LljAOQNEnMg-- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Wed, 16 Jul 2014 16:20:33 +1000 Message-Id: <1405491633-3537-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 1.9.3 Subject: [Piglit] [PATCH V2] arb_arrays_of_arrays: geometry shader tests X-BeenThere: piglit@lists.freedesktop.org X-Mailman-Version: 2.1.15 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 2607:f8b0:400c:c03::22f 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 --- ...-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() +{ +}