From patchwork Mon Jun 23 22:20:59 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: 32391 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BE10B203AC for ; Mon, 23 Jun 2014 22:21:20 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id hn18sf13478377igb.3 for ; Mon, 23 Jun 2014 15:21:20 -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=GP9Jx7IjWg6yIPN0EkkHlTC44Sbnayin2HLEP28d33Q=; b=cc8QneMB7Fwkf7ezOvh6Lywvl5fNUgx7/6gj9rhPZ17nolNIUG3qL3p2X1AMIYLIYY hfIDk+vQyIQyWx3IaUtfML45ubU4FNul5CQeq4GaOJNfSWaDdJv8zhZ256EitgN9xj12 PqEKW6tmpaU/o9Fyg5hXQrxi5K+y1JJQ/bJjBPUMoBhrd/c8H2YWvUM5BduGJZeDURay lTK8LRQOM4TO8KZ7S2NGgwO2xowx3e5mPerh42Sy30AmdPNmmUKitt9DvLM2K2NZmT/G 7qRMW/Ub6frv7h0gcGJUvE7nbqtu+oBUvuGeoz9Gd2VqpLFXkjlKSyjSzEO+G2WMsWZS trWA== X-Gm-Message-State: ALoCoQlcwG68NvtTrBFzOS+jleJddgPWETJohH0dIxU3aFvTRb7Mn/NMlZNZQVltQ67i5oCjcYsX X-Received: by 10.50.87.65 with SMTP id v1mr11313634igz.0.1403562079940; Mon, 23 Jun 2014 15:21:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.5 with SMTP id 5ls711665qgi.98.gmail; Mon, 23 Jun 2014 15:21:19 -0700 (PDT) X-Received: by 10.52.117.209 with SMTP id kg17mr18152340vdb.28.1403562079773; Mon, 23 Jun 2014 15:21:19 -0700 (PDT) Received: from mail-vc0-x229.google.com (mail-vc0-x229.google.com [2607:f8b0:400c:c03::229]) by mx.google.com with ESMTPS id sa4si9705711vdc.98.2014.06.23.15.21.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 15:21:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::229 as permitted sender) client-ip=2607:f8b0:400c:c03::229; Received: by mail-vc0-f169.google.com with SMTP id la4so6782465vcb.14 for ; Mon, 23 Jun 2014 15:21:19 -0700 (PDT) X-Received: by 10.52.232.133 with SMTP id to5mr18018934vdc.16.1403562079652; Mon, 23 Jun 2014 15:21:19 -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 tc5csp162046vcb; Mon, 23 Jun 2014 15:21:19 -0700 (PDT) X-Received: by 10.66.156.71 with SMTP id wc7mr33470382pab.64.1403562078849; Mon, 23 Jun 2014 15:21:18 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id hd2si23652350pbb.196.2014.06.23.15.21.18 for ; Mon, 23 Jun 2014 15:21:18 -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 43F5C6E48F; Mon, 23 Jun 2014 15:21:18 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm1-vm1.bullet.mail.bf1.yahoo.com (nm1-vm1.bullet.mail.bf1.yahoo.com [98.139.213.163]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D2F56E48F for ; Mon, 23 Jun 2014 15:21:16 -0700 (PDT) Received: from [98.139.212.150] by nm1.bullet.mail.bf1.yahoo.com with NNFMP; 23 Jun 2014 22:21:15 -0000 Received: from [98.139.211.201] by tm7.bullet.mail.bf1.yahoo.com with NNFMP; 23 Jun 2014 22:21:15 -0000 Received: from [127.0.0.1] by smtp210.mail.bf1.yahoo.com with NNFMP; 23 Jun 2014 22:21:15 -0000 X-Yahoo-Newman-Id: 126353.74535.bm@smtp210.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: czDTAN4VM1kK0lj6CpIFc5YoFT5JMHUVWOk5aKrKUYeqG.t _OtNkK7s4gnYoPscvRshSv3bNKakEB2iFWQVMQPzBfccrJPWNM7ArNohEQ.p wjpBgmFa98rvO6m25FbDydxsptHFTVlQZaiPb8QZUkwLDY2hxZG.c0vjHdg_ xaNzS4UtNulNPiceI9AWc92bgdCtGr_XVxDwTc1jDGBm.z10kKPBhhiO.HM8 eQ9Z4aPZteCHtvY2lmd8yD8mTg0FXmg3q8ZNBATQie8_wIfR9cF2rsrTkOUk HsmMTKh8THbXdzAwxpxT7hI2ZLa7ul.pjxzQtSjmmmDpOI65Q5dfcSQ.tinQ kIflMDG7IzPeFqrEyGxDZ2WkFslNOWavC4wAVWyWcPgiykTxQiQXof6t0brr b_wN08jWvyH6SI4FRHszhBomSgOtYmXRRAdcZLK8h5kUZfOUmEVE1tfGTWf7 cP.P3UUe1AFrdut_zHauNaufI93gcy7gNChTxIeFRGjHAKgtUQAB.rbgYu_l B2fL5V6LXwHHnH7n56FTXkK8v X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU X-Rocket-Received: from localhost.localdomain (t_arceri@101.119.29.188 with plain [98.138.105.21]) by smtp210.mail.bf1.yahoo.com with SMTP; 23 Jun 2014 15:21:15 -0700 PDT From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Tue, 24 Jun 2014 08:20:59 +1000 Message-Id: <1403562059-22921-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 1.9.3 Subject: [Piglit] [PATCH] 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::229 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 Test results are from the following hardware/driver combination: AMD Radeon HD 6670 - Catalyst 13.251 OpenGL 4.3 gs-input-sizing-consistent-with-prev-length-blocks.geom pass gs-input-sizing-consistent-with-prev-length.geom pass gs-input-sizing-implied-length-blocks.geom pass gs-input-sizing-implied-length-consistent-with-prev-usage-blocks.geom pass gs-input-sizing-implied-length-consistent-with-prev-usage.geom pass gs-input-sizing-implied-length-inconsistent-with-prev-usage-blocks.geom fail gs-input-sizing-implied-length-inconsistent-with-prev-usage.geom fail gs-input-sizing-implied-length.geom pass gs-input-sizing-inconsistent-blocks-invalid.geom fail gs-input-sizing-inconsistent-blocks-valid.geom pass gs-input-sizing-inconsistent-invalid.geom fail gs-input-sizing-inconsistent-valid.geom pass gs-output.geom pass gs-redeclares-pervertex-in-as-array-of-arrays.geom fail gs-redeclares-pervertex-in-as-array-of-arrays2.geom fail 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() +{ +}