From patchwork Fri Apr 26 21:53:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 16445 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f200.google.com (mail-gg0-f200.google.com [209.85.161.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 614632397A for ; Fri, 26 Apr 2013 21:55:25 +0000 (UTC) Received: by mail-gg0-f200.google.com with SMTP id w6sf6674705ggk.3 for ; Fri, 26 Apr 2013 14:54:29 -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=HBrNjYjS6kEHH3Cpgo/VdamNGt6OKpJ5g7YjKuDTFEU=; b=YZUPYQ1w2jpPeyI0m/9lJtNkCgugBtSJ0qq+fI0iu6ef5PTSy5g5mNM2x8HI1v1OkG EG1RTj6qNM4BOM+uKD9ev727aXq7my8FOJjwzUrsxRbQxSUKULC2JzLv1nEV4rL/f7x3 YCA/JYqS9+rR3vNU4BWyDzVnpPS55akCUjHB2CwTzlyxxcv0MjOji0hQfHSi6NzZmjmh dOUyUIHSoF/gnXxxUbnyr+vBjLjVLELR5FvokCg8XhWTijdKj9LHnrlp8G95VxDc2kqi 7UjfSQjatl+0XI9doPsRJKl+9Xaxw/fY0RsYlrDvJQdqn/FD3csAg86f6Sv9Dzj+31AM dG9Q== X-Received: by 10.236.226.3 with SMTP id a3mr21373598yhq.12.1367013268968; Fri, 26 Apr 2013 14:54:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.42.106 with SMTP id n10ls550664qel.90.gmail; Fri, 26 Apr 2013 14:54:28 -0700 (PDT) X-Received: by 10.58.144.133 with SMTP id sm5mr29840710veb.23.1367013268728; Fri, 26 Apr 2013 14:54:28 -0700 (PDT) Received: from mail-vb0-x230.google.com (mail-vb0-x230.google.com [2607:f8b0:400c:c02::230]) by mx.google.com with ESMTPS id da5si6157142vdc.24.2013.04.26.14.54.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:28 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::230 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:c02::230; Received: by mail-vb0-f48.google.com with SMTP id p13so3903744vbe.21 for ; Fri, 26 Apr 2013 14:54:28 -0700 (PDT) X-Received: by 10.52.228.71 with SMTP id sg7mr24548995vdc.51.1367013268507; Fri, 26 Apr 2013 14:54:28 -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 nf2csp86631veb; Fri, 26 Apr 2013 14:54:28 -0700 (PDT) X-Received: by 10.50.184.132 with SMTP id eu4mr2940942igc.19.1367013267829; Fri, 26 Apr 2013 14:54:27 -0700 (PDT) Received: from mail-ie0-x22e.google.com (mail-ie0-x22e.google.com [2607:f8b0:4001:c03::22e]) by mx.google.com with ESMTPS id bj6si4663017igb.52.2013.04.26.14.54.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:27 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4001:c03::22e is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=2607:f8b0:4001:c03::22e; Received: by mail-ie0-f174.google.com with SMTP id 10so5526242ied.33 for ; Fri, 26 Apr 2013 14:54:27 -0700 (PDT) X-Received: by 10.43.12.66 with SMTP id ph2mr25442552icb.5.1367013267567; Fri, 26 Apr 2013 14:54:27 -0700 (PDT) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPSA id s16sm5043264ign.4.2013.04.26.14.54.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:26 -0700 (PDT) From: Tom Gall To: piglit@lists.freedesktop.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 02/10] glsl-es-1.00: array tests using a variety of indexes Date: Fri, 26 Apr 2013 16:53:36 -0500 Message-Id: <1367013224-21359-2-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: ALoCoQkVp+wLwCtornWfbY172w1ANG58o5IlTSEt5wLUo2tIx6/ZlNiDGrdcsTBVZP3/7niZMXCh X-Original-Sender: tom.gall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::230 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 constant index array tests including valid, negative and outside of the range. Signed-off-by: Tom Gall --- .../array-constant-index-implicit-size.vert | 29 ++++++++++++++++++++ .../array-constant-index-negative.vert | 18 ++++++++++++ .../array-constant-index-too-large.vert | 18 ++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert new file mode 100644 index 0000000..d46fdc7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert @@ -0,0 +1,29 @@ +/* [config] + * expect_result: pass + * glsles_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." + */ + + +/* Assume the array is sized in a different compilation unit. + */ +vec4 [] an_array; + +void main() +{ + gl_Position = an_array[2]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert new file mode 100644 index 0000000..2384705 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert @@ -0,0 +1,18 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 24 of the GLSL ES 1.00.17 spec: + * + * "It is also illegal to index an array with a negative constant + * expression." + */ + + +uniform vec4 [6] an_array; + +void main() +{ + gl_Position = an_array[-1]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert new file mode 100644 index 0000000..f3838ea --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert @@ -0,0 +1,18 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From Page 24 of the GLSL ES 1.00.17 spec: + * + * "It is illegal to index an array with an integral constant expression + * greater than or equal to it's declared size." + */ + + +uniform vec4 [6] an_array; + +void main() +{ + gl_Position = an_array[6]; +}