From patchwork Fri Apr 26 21:53:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 16448 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f197.google.com (mail-gh0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 771BB2397A for ; Fri, 26 Apr 2013 21:55:33 +0000 (UTC) Received: by mail-gh0-f197.google.com with SMTP id r17sf1491644ghr.0 for ; Fri, 26 Apr 2013 14:54:37 -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=JJlUhThIhsDxTezYDgMrDdqz485fQYBekgLrGaKE63I=; b=SjI3jfOQ5zo8iAqwWygx6bmqlg7xilzwFb3caOC2RycvgzSPN0II3kg4SXNjzqVhZG mxPDRQyQgMHGTaonNXFu3Ylq94+EZDk/i1s+/TrvDZnwFKtgkFFjLZbhb9fRpUO7r3zo ZZvgOnkmeZ2p+uMF6eiV7ACln24DCgJV+LCyXsvxNs9YBGKnImzdKQZ2YUX3dAZ3ZyNI 12JvaXPmUn6G9/gv1dPlgbh9BipXlOWgVmjxRkCdJ0UEoQK4j9nTZjtByoNtMEKXXrFq GT4eD7hEi+b+DUl8f1ZHQxaKoPVgRX0Od3uVtASL5ssO1YYgZj4UTHxGFEozbR/HitS+ fTNw== X-Received: by 10.224.58.77 with SMTP id f13mr31666461qah.7.1367013277009; Fri, 26 Apr 2013 14:54:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.37 with SMTP id r5ls1997645qeu.15.gmail; Fri, 26 Apr 2013 14:54:36 -0700 (PDT) X-Received: by 10.220.147.79 with SMTP id k15mr15628942vcv.38.1367013276764; Fri, 26 Apr 2013 14:54:36 -0700 (PDT) Received: from mail-ve0-x233.google.com (mail-ve0-x233.google.com [2607:f8b0:400c:c01::233]) by mx.google.com with ESMTPS id a6si6144912vcx.38.2013.04.26.14.54.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:36 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::233 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::233; Received: by mail-ve0-f179.google.com with SMTP id oz10so2067764veb.38 for ; Fri, 26 Apr 2013 14:54:36 -0700 (PDT) X-Received: by 10.52.69.109 with SMTP id d13mr3092725vdu.75.1367013276560; Fri, 26 Apr 2013 14:54:36 -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 nf2csp86638veb; Fri, 26 Apr 2013 14:54:36 -0700 (PDT) X-Received: by 10.50.62.66 with SMTP id w2mr2910714igr.81.1367013275794; Fri, 26 Apr 2013 14:54:35 -0700 (PDT) Received: from mail-ia0-x22f.google.com (mail-ia0-x22f.google.com [2607:f8b0:4001:c02::22f]) by mx.google.com with ESMTPS id oy9si16364830icb.3.2013.04.26.14.54.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:35 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4001:c02::22f is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=2607:f8b0:4001:c02::22f; Received: by mail-ia0-f175.google.com with SMTP id i38so4120179iae.34 for ; Fri, 26 Apr 2013 14:54:35 -0700 (PDT) X-Received: by 10.50.50.40 with SMTP id z8mr3033069ign.59.1367013275335; Fri, 26 Apr 2013 14:54:35 -0700 (PDT) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPSA id s16sm5043264ign.4.2013.04.26.14.54.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:34 -0700 (PDT) From: Tom Gall To: piglit@lists.freedesktop.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 05/10] glsl-es-1.00: new tests for array function params and return types Date: Fri, 26 Apr 2013 16:53:39 -0500 Message-Id: <1367013224-21359-5-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: ALoCoQnb3iogjv7j7cT5un26qgPaulyVT6Z7nvaggSQRj6AKv5/+qIK6UncES2XDWSVgrvVvnxno X-Original-Sender: tom.gall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::233 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 tests used as function params and return types. Signed-off-by: Tom Gall --- .../array-function-parameter-implicit-size.vert | 36 ++++++++++++++++++++ .../array-function-parameter-unsized.vert | 29 ++++++++++++++++ .../array-function-return-unsized.vert | 31 +++++++++++++++++ .../array-function-return.vert | 30 ++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-implicit-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.vert diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-implicit-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-implicit-size.vert new file mode 100644 index 0000000..f050c87 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-implicit-size.vert @@ -0,0 +1,36 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * The GLSL ES 1.00 spec takes no position on what should + * happen with a undeclared array size. + * + * The GLSL ES 3.00 spec on page 136 in section 12.22 within + * the issues chapter says : + * + * "float a[5]; + * ... + * float b[] = a; // bi is explicity size 5 " + * + * Further, "However, any declaration that leaves the size + * undefined is disallowed as this would add complexity and there are + * no use-cases. + */ + + +float a_function(vec4[6]); + +void main() +{ + vec4 [] an_array; + + an_array[0] = vec4(0); + an_array[1] = vec4(1); + an_array[2] = vec4(2); + an_array[3] = vec4(3); + an_array[4] = vec4(4); + an_array[5] = vec4(5); + + gl_Position = vec4(a_function(an_array)); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert new file mode 100644 index 0000000..4a536a9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert @@ -0,0 +1,29 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * The GLSL ES 1.00 spec takes no position on what should + * happen with a undeclared array size. + * + * The GLSL ES 3.00 spec on page 136 in section 12.22 within + * the issues chapter says : + * + * "float a[5]; + * ... + * float b[] = a; // bi is explicity size 5 " + * + * Further, "However, any declaration that leaves the size + * undefined is disallowed as this would add complexity and there are + * no use-cases. + */ + + +vec4 a_function(vec4 [] p); + +uniform vec4 [6] an_array; + +void main() +{ + gl_Position = a_function(an_array); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert new file mode 100644 index 0000000..49a80e5 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert @@ -0,0 +1,31 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 24, GLSL ES 1.00.17 spec: + * + * "Arrays declared as formal parameters in a function + * declaration must specify a size." + * + * The GLSL ES 3.00 spec on page 136 in section 12.22 within + * the issues chapter says : + * + * "float a[5]; + * ... + * float b[] = a; // bi is explicity size 5 " + * + * Further, "However, any declaration that leaves the size + * undefined is disallowed as this would add complexity and there are + * no use-cases. + */ + + +vec4[] a_function(vec4 [6] p); + +uniform vec4 [6] an_array; + +void main() +{ + gl_Position = a_function(an_array)[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.vert new file mode 100644 index 0000000..a560685 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.vert @@ -0,0 +1,30 @@ +/* [config] + * expect_result: pass + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "This type can be used anywhere any other type can be used, including + * as the return value from a function + * + * float[5] foo() { } + * + * as a constructor of an array + * + * float[5](3.4, 4.2, 5.0, 5.2, 1.1) + * + * as an unnamed parameter + * + * void foo(float[5])" + */ + + +vec4[2] a_function(vec4 [6]); + +uniform vec4 [6] an_array; + +void main() +{ + gl_Position = a_function(an_array)[0]; +}