From patchwork Fri Apr 26 21:53:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 16449 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EF1452397A for ; Fri, 26 Apr 2013 21:55:37 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id ev20sf6270015lab.9 for ; Fri, 26 Apr 2013 14:54:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=shfT5Mi9t97KO1Qcjb0k0gacH9VR08ylmgKVvILsGeY=; b=GIN5YfhTcIuULgQjrljBHIq5z6obDcYB1JHauhxB9Q5LSWgdyTCzx527RFyNkfNneh IrYeB1N43gglKcbUeNOxDjml6nKyEXKH6CS6HPM3YpU2X2YdpaOJKjScTq9H6+FXfAFA PNN4E4KU3RMD+oI4k6rr95Pt2KuoTIYUgMwJyTJKKcBVLsMkjhVIM/blj+1HbsJNsgh5 c9DVwGShVLM9RFdTCWmMCOiVR/q6hD8CvJaGgD9KEtEKr85TMOi3pbulv0mKXUU1KqCP z2YUfuJY3Gp05ybm6b9JXV5BVZGjYICO7v0fZv/jRZlCjpwgQUXUNz4bIz35KfNcPeR/ O5jA== X-Received: by 10.180.198.210 with SMTP id je18mr2519047wic.1.1367013280518; Fri, 26 Apr 2013 14:54:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.160.231 with SMTP id xn7ls311278wib.23.canary; Fri, 26 Apr 2013 14:54:40 -0700 (PDT) X-Received: by 10.194.89.234 with SMTP id br10mr27280322wjb.43.1367013280397; Fri, 26 Apr 2013 14:54:40 -0700 (PDT) Received: from mail-ve0-x235.google.com (mail-ve0-x235.google.com [2607:f8b0:400c:c01::235]) by mx.google.com with ESMTPS id o3si4439746wja.226.2013.04.26.14.54.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:40 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::235; Received: by mail-ve0-f181.google.com with SMTP id d10so2055005vea.26 for ; Fri, 26 Apr 2013 14:54:39 -0700 (PDT) X-Received: by 10.52.166.103 with SMTP id zf7mr25440890vdb.94.1367013279059; Fri, 26 Apr 2013 14:54:39 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp86640veb; Fri, 26 Apr 2013 14:54:38 -0700 (PDT) X-Received: by 10.42.63.133 with SMTP id c5mr25212288ici.41.1367013278261; Fri, 26 Apr 2013 14:54:38 -0700 (PDT) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [2607:f8b0:4001:c03::235]) by mx.google.com with ESMTPS id pp8si11499404icb.70.2013.04.26.14.54.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:38 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4001:c03::235 is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=2607:f8b0:4001:c03::235; Received: by mail-ie0-f181.google.com with SMTP id tp5so5535233ieb.12 for ; Fri, 26 Apr 2013 14:54:38 -0700 (PDT) X-Received: by 10.50.28.112 with SMTP id a16mr2948631igh.23.1367013278017; Fri, 26 Apr 2013 14:54:38 -0700 (PDT) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPSA id s16sm5043264ign.4.2013.04.26.14.54.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:37 -0700 (PDT) From: Tom Gall To: piglit@lists.freedesktop.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 06/10] glsl-es-1.00: new array size tests using a variety of types Date: Fri, 26 Apr 2013 16:53:40 -0500 Message-Id: <1367013224-21359-6-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1367013224-21359-1-git-send-email-tom.gall@linaro.org> References: <1367013224-21359-1-git-send-email-tom.gall@linaro.org> X-Gm-Message-State: ALoCoQlg6pmp4E3YOXrs2q8Ip+f/ffm11sbf4CndaunMS46RUfBcHXiKqVpcpQXJuGzs4h+iTUSi X-Original-Sender: tom.gall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add to tests/spec/glsl-es-1.00/compiler/structure-and-array-operations a series of array declaration size tests. Signed-off-by: Tom Gall --- .../array-size-bool.vert | 16 ++ .../array-size-bvec2.vert | 16 ++ .../array-size-bvec3.vert | 16 ++ .../array-size-bvec4.vert | 16 ++ .../array-size-constant-cast.vert | 17 +++ .../array-size-constant-relational.vert | 161 ++++++++++++++++++++ .../array-size-float.vert | 16 ++ .../array-size-int.vert | 16 ++ .../array-size-ivec2.vert | 16 ++ .../array-size-ivec3.vert | 16 ++ .../array-size-ivec4.vert | 16 ++ .../array-size-length.vert | 17 +++ .../array-size-negative.vert | 16 ++ .../array-size-non-builtin-function.vert | 18 +++ .../array-size-not-constant.vert | 17 +++ .../array-size-selection.vert | 21 +++ .../array-size-sequence-in-parenthesis.vert | 29 ++++ .../array-size-sequence.vert | 29 ++++ .../array-size-vec2.vert | 16 ++ .../array-size-vec3.vert | 16 ++ .../array-size-vec4.vert | 16 ++ .../array-size-with-side-effect.vert | 19 +++ .../array-size-zero.vert | 16 ++ 23 files changed, 552 insertions(+) create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-cast.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-relational.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-float.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-int.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-length.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-negative.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-non-builtin-function.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-not-constant.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-selection.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence-in-parenthesis.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-with-side-effect.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-zero.vert diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert new file mode 100644 index 0000000..06d451b --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [true] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec2.vert new file mode 100644 index 0000000..c52d636 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec2.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [bvec2(true, false)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec3.vert new file mode 100644 index 0000000..47db72e --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec3.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [bvec3(true, true, false)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec4.vert new file mode 100644 index 0000000..f87cbed --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec4.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [bvec4(true, true, false, false)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-cast.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-cast.vert new file mode 100644 index 0000000..9daf4a3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-cast.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +const float size = 3.14159; +uniform vec4 [int(size)] a; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-relational.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-relational.vert new file mode 100644 index 0000000..de5a931 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-relational.vert @@ -0,0 +1,161 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +const vec4 v4_1 = vec4(1); +const vec4 v4_0 = v4_1 - v4_1; +const vec3 v3_1 = vec3(1); +const vec3 v3_0 = v3_1 - v3_1; +const vec2 v2_1 = vec2(1); +const vec2 v2_0 = v2_1 - v2_1; + +const ivec4 iv4_1 = ivec4(1); +const ivec4 iv4_0 = iv4_1 - iv4_1; +const ivec3 iv3_1 = ivec3(1); +const ivec3 iv3_0 = iv3_1 - iv3_1; +const ivec2 iv2_1 = ivec2(1); +const ivec2 iv2_0 = iv2_1 - iv2_1; + +const bvec4 bv4_1 = bvec4(true); +const bvec4 bv4_0 = not(bv4_1); +const bvec3 bv3_1 = bvec3(true); +const bvec3 bv3_0 = not(bv3_1); +const bvec2 bv2_1 = bvec2(true); +const bvec2 bv2_0 = not(bv2_1); + +// All forms of lessThan. +float [all( lessThan( v4_1, v4_0) ) ? -1 : 1] array01; +float [all(not(lessThan( v4_1, v4_0))) ? 1 : -1] array02; +float [any( lessThan( v4_1, v4_0) ) ? -1 : 1] array03; +float [any(not(lessThan( v4_1, v4_0))) ? 1 : -1] array04; +float [all( lessThan(iv4_1, iv4_0) ) ? -1 : 1] array05; +float [all(not(lessThan(iv4_1, iv4_0))) ? 1 : -1] array06; +float [any( lessThan(iv4_1, iv4_0) ) ? -1 : 1] array07; +float [any(not(lessThan(iv4_1, iv4_0))) ? 1 : -1] array08; + +// All forms of lessThanEqual. +float [all( lessThanEqual( v4_1, v4_0) ) ? -1 : 1] array11; +float [all(not(lessThanEqual( v4_1, v4_0))) ? 1 : -1] array12; +float [any( lessThanEqual( v4_1, v4_0) ) ? -1 : 1] array13; +float [any(not(lessThanEqual( v4_1, v4_0))) ? 1 : -1] array14; +float [all( lessThanEqual(iv4_1, iv4_0) ) ? -1 : 1] array15; +float [all(not(lessThanEqual(iv4_1, iv4_0))) ? 1 : -1] array16; +float [any( lessThanEqual(iv4_1, iv4_0) ) ? -1 : 1] array17; +float [any(not(lessThanEqual(iv4_1, iv4_0))) ? 1 : -1] array18; + +// All forms of greaterThan. +float [all( greaterThan( v4_1, v4_0) ) ? 1 : -1] array21; +float [all(not(greaterThan( v4_1, v4_0))) ? -1 : 1] array22; +float [any( greaterThan( v4_1, v4_0) ) ? 1 : -1] array23; +float [any(not(greaterThan( v4_1, v4_0))) ? -1 : 1] array24; +float [all( greaterThan(iv4_1, iv4_0) ) ? 1 : -1] array25; +float [all(not(greaterThan(iv4_1, iv4_0))) ? -1 : 1] array26; +float [any( greaterThan(iv4_1, iv4_0) ) ? 1 : -1] array27; +float [any(not(greaterThan(iv4_1, iv4_0))) ? -1 : 1] array28; + +// All forms of greaterThanEqual. +float [all( greaterThanEqual( v4_1, v4_0) ) ? 1 : -1] array31; +float [all(not(greaterThanEqual( v4_1, v4_0))) ? -1 : 1] array32; +float [any( greaterThanEqual( v4_1, v4_0) ) ? 1 : -1] array33; +float [any(not(greaterThanEqual( v4_1, v4_0))) ? -1 : 1] array34; +float [all( greaterThanEqual(iv4_1, iv4_0) ) ? 1 : -1] array35; +float [all(not(greaterThanEqual(iv4_1, iv4_0))) ? -1 : 1] array36; +float [any( greaterThanEqual(iv4_1, iv4_0) ) ? 1 : -1] array37; +float [any(not(greaterThanEqual(iv4_1, iv4_0))) ? -1 : 1] array38; + +// All forms of equal. +float [all( equal( v4_1, v4_0) ) ? -1 : 1] array41; +float [all(not(equal( v4_1, v4_0))) ? 1 : -1] array42; +float [any( equal( v4_1, v4_0) ) ? -1 : 1] array43; +float [any(not(equal( v4_1, v4_0))) ? 1 : -1] array44; +float [all( equal(iv4_1, iv4_0) ) ? -1 : 1] array45; +float [all(not(equal(iv4_1, iv4_0))) ? 1 : -1] array46; +float [any( equal(iv4_1, iv4_0) ) ? -1 : 1] array47; +float [any(not(equal(iv4_1, iv4_0))) ? 1 : -1] array48; +float [all( equal(bv4_1, bv4_0) ) ? -1 : 1] array49; +float [all(not(equal(bv4_1, bv4_0))) ? 1 : -1] array4a; +float [any( equal(bv4_1, bv4_0) ) ? -1 : 1] array4b; +float [any(not(equal(bv4_1, bv4_0))) ? 1 : -1] array4c; + +// All forms of notEqual. +float [all( notEqual( v4_1, v4_0) ) ? 1 : -1] array51; +float [all(not(notEqual( v4_1, v4_0))) ? -1 : 1] array52; +float [any( notEqual( v4_1, v4_0) ) ? 1 : -1] array53; +float [any(not(notEqual( v4_1, v4_0))) ? -1 : 1] array54; +float [all( notEqual(iv4_1, iv4_0) ) ? 1 : -1] array55; +float [all(not(notEqual(iv4_1, iv4_0))) ? -1 : 1] array56; +float [any( notEqual(iv4_1, iv4_0) ) ? 1 : -1] array57; +float [any(not(notEqual(iv4_1, iv4_0))) ? -1 : 1] array58; +float [all( notEqual(bv4_1, bv4_0) ) ? 1 : -1] array59; +float [all(not(notEqual(bv4_1, bv4_0))) ? -1 : 1] array5a; +float [any( notEqual(bv4_1, bv4_0) ) ? 1 : -1] array5b; +float [any(not(notEqual(bv4_1, bv4_0))) ? -1 : 1] array5c; + +void main() +{ + gl_Position = vec4(array01.length() + + array02.length() + + array03.length() + + array04.length() + + array05.length() + + array06.length() + + array07.length() + + array08.length() + + array11.length() + + array12.length() + + array13.length() + + array14.length() + + array15.length() + + array16.length() + + array17.length() + + array18.length() + + array21.length() + + array22.length() + + array23.length() + + array24.length() + + array25.length() + + array26.length() + + array27.length() + + array28.length() + + array31.length() + + array32.length() + + array33.length() + + array34.length() + + array35.length() + + array36.length() + + array37.length() + + array38.length() + + array41.length() + + array42.length() + + array43.length() + + array44.length() + + array45.length() + + array46.length() + + array47.length() + + array48.length() + + array49.length() + + array4a.length() + + array4b.length() + + array4c.length() + + array51.length() + + array52.length() + + array53.length() + + array54.length() + + array55.length() + + array56.length() + + array57.length() + + array58.length() + + array59.length() + + array5a.length() + + array5b.length() + + array5c.length()); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-float.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-float.vert new file mode 100644 index 0000000..80f4cd7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-float.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [2.3] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-int.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-int.vert new file mode 100644 index 0000000..0b7ce81 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-int.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [int(2.3)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec2.vert new file mode 100644 index 0000000..0828024 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec2.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [ivec2(2.3,2.3)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec3.vert new file mode 100644 index 0000000..4f3b212 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec3.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [ivec3(2.3,2.3,2.3)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec4.vert new file mode 100644 index 0000000..920444f --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec4.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [ivec4(2.3,2.3,2.3,2.3)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-length.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-length.vert new file mode 100644 index 0000000..afa6d47 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-length.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform vec4 [3] a; +uniform vec4 [a.length()] b; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-negative.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-negative.vert new file mode 100644 index 0000000..be439fe --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-negative.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform vec4 [-1] a; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-non-builtin-function.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-non-builtin-function.vert new file mode 100644 index 0000000..23abb99 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-non-builtin-function.vert @@ -0,0 +1,18 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +int foo() { return 3; } + +uniform vec4 [foo()] a; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-not-constant.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-not-constant.vert new file mode 100644 index 0000000..631a4bc --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-not-constant.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform int size; +uniform vec4 [size] a; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-selection.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-selection.vert new file mode 100644 index 0000000..54c0a98 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-selection.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +const vec4[] a = vec4[](vec4(0), vec4(1)); +const vec4[] b = vec4[](vec4(1), vec4(0)); +uniform vec4 c[((true) ? a : b).length()]; + +void main() +{ + gl_Position = c[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence-in-parenthesis.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence-in-parenthesis.vert new file mode 100644 index 0000000..43267c6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence-in-parenthesis.vert @@ -0,0 +1,29 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * The body of the GLSL spec is slient on this issue, but the grammar says: + * + * expression: + * assignment_expression + * expression COMMA assignment_expression + * + * constant_expression: + * conditional_expression + * + * ... + * + * init_declarator_list: + * single_declaration + * init_declarator_list COMMA IDENTIFIER + * init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET + * init_declarator_list COMMA IDENTIFIER EQUAL initializer + * + * This also matches C and C++. + */ + + +uniform float a[(5,3)]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence.vert new file mode 100644 index 0000000..cf325f6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence.vert @@ -0,0 +1,29 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * The body of the GLSL spec is slient on this issue, but the grammar says: + * + * expression: + * assignment_expression + * expression COMMA assignment_expression + * + * constant_expression: + * conditional_expression + * + * ... + * + * init_declarator_list: + * single_declaration + * init_declarator_list COMMA IDENTIFIER + * init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET + * init_declarator_list COMMA IDENTIFIER EQUAL initializer + * + * This also matches C and C++. + */ + + +uniform float a[5,3]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec2.vert new file mode 100644 index 0000000..9c01854 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec2.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [vec2(2,2)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec3.vert new file mode 100644 index 0000000..d1936dd --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec3.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [vec3(2,2,2)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec4.vert new file mode 100644 index 0000000..06a5ab3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec4.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform float [vec4(2,2,2,2)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-with-side-effect.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-with-side-effect.vert new file mode 100644 index 0000000..f0a5564 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-with-side-effect.vert @@ -0,0 +1,19 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +void main() +{ + int x; + vec4[(x = 3)] a; + gl_Position = vec4(0.0); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-zero.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-zero.vert new file mode 100644 index 0000000..156eeae --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-zero.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00 spec: + * + * "The array size must be an integral constant expression (see + * Section 4.3.3 "Integral Constant Expressions") greater than + * zero." + */ + + +uniform vec4 [0] a; + +void main() { gl_Position = vec4(0.0); }