From patchwork Fri Apr 26 21:53:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 16451 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CB5AF2397A for ; Fri, 26 Apr 2013 21:55:41 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id b4sf8641830qen.6 for ; Fri, 26 Apr 2013 14:54:45 -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=xrWFDaJtEtOblyW0v7u8nYJ0IU2nVa30obKcS/DZqHY=; b=K7aM3xNNe1Uo2asO6n3XzWQgt86nWyyLoG0OYh50VUy0xw6idtPqeFrItoR/FnbjTw oHmEE48lJ1xZ8AYKx+p2l+aLP4BKKlCWofpviynwl55w/z73lc/+q3BGWX3iy07p9GeG 2moEIvz194nUayZakqHroefXsKHMzok/RVnbh2xv8yd/tL8QaQet/8UWLEqMAyO/nt/3 xeLsRcE69Uzqnd18AjOSuxiu7BgPEyKjX4NvWR/Z30VSu40ptsRPEhuJAk6yegNQVOPZ lJCXd0MwWW72HnEGYtE5lzkfdFJkomITDsWPlvL8mtCIPfoAcSeGf+gMf8NDPYnixFyO Ip+Q== X-Received: by 10.236.170.7 with SMTP id o7mr22434220yhl.1.1367013285442; Fri, 26 Apr 2013 14:54:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.132.2 with SMTP id oq2ls2098825qeb.94.gmail; Fri, 26 Apr 2013 14:54:45 -0700 (PDT) X-Received: by 10.52.26.102 with SMTP id k6mr3077965vdg.127.1367013285210; Fri, 26 Apr 2013 14:54:45 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id sx2si6139057vdc.71.2013.04.26.14.54.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf10so4155577vcb.20 for ; Fri, 26 Apr 2013 14:54:45 -0700 (PDT) X-Received: by 10.52.163.231 with SMTP id yl7mr25304021vdb.57.1367013285051; Fri, 26 Apr 2013 14:54:45 -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 nf2csp86644veb; Fri, 26 Apr 2013 14:54:44 -0700 (PDT) X-Received: by 10.42.89.7 with SMTP id e7mr19498171icm.19.1367013284306; Fri, 26 Apr 2013 14:54:44 -0700 (PDT) Received: from mail-ia0-x229.google.com (mail-ia0-x229.google.com [2607:f8b0:4001:c02::229]) by mx.google.com with ESMTPS id gh4si4673937igb.50.2013.04.26.14.54.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:43 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4001:c02::229 is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=2607:f8b0:4001:c02::229; Received: by mail-ia0-f169.google.com with SMTP id l29so4169342iag.0 for ; Fri, 26 Apr 2013 14:54:43 -0700 (PDT) X-Received: by 10.50.40.162 with SMTP id y2mr3038197igk.65.1367013283499; Fri, 26 Apr 2013 14:54:43 -0700 (PDT) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPSA id s16sm5043264ign.4.2013.04.26.14.54.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 14:54:42 -0700 (PDT) From: Tom Gall To: piglit@lists.freedesktop.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 08/10] glsl-es-1.00:=, !=, * and multidim structure and array operations Date: Fri, 26 Apr 2013 16:53:42 -0500 Message-Id: <1367013224-21359-8-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: ALoCoQkm2cMYyYbZo4bKXdvZqJFBoWlhn22BQJQC+MhWtTacGv4ewsxuvvkrPt5dJLs5PJRIJOKD X-Original-Sender: tom.gall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 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 glslparser tests for arrays and assignment, multidimensional, multiply, and not equal. Signed-off-by: Tom Gall --- .../array-assign.vert | 27 +++++++++++++++++++ .../array-multidimensional-new-syntax.vert | 17 ++++++++++++ .../array-multidimensional.vert | 17 ++++++++++++ .../array-multiply.vert | 23 ++++++++++++++++ .../array-not-equal-implicit-size.vert | 28 ++++++++++++++++++++ .../array-not-equal-matrix.vert | 22 +++++++++++++++ .../array-not-equal-mismatched-base-type.vert | 22 +++++++++++++++ .../array-not-equal-mismatched-size.vert | 22 +++++++++++++++ .../array-not-equal-vertor.vert | 22 +++++++++++++++ .../array-not-equal.vert | 22 +++++++++++++++ 10 files changed, 222 insertions(+) create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional-new-syntax.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-implicit-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-matrix.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-base-type.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-vertor.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal.vert diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert new file mode 100644 index 0000000..56c480d --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert @@ -0,0 +1,27 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.00 + * [end config] + * + * From page 46 of the GLSL ES 1.00.17 spec: + * + * "Assignments of values to variables are performed using the assignment + * operator (=). + * ... + * and l-values dereferenced with the array subsript operator ([]) are + * all l-values." + */ + + +void main() +{ + vec4 a[2]; + vec4 b[2]; + vec4 c[2]; + + a = vec4[2](vec4(0.0), vec4(2.0)); + b = vec4[ ](vec4(0.5), vec4(2.0)); + c = a; + + gl_Position = a[0] + b[0] + c[1]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional-new-syntax.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional-new-syntax.vert new file mode 100644 index 0000000..05db993 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional-new-syntax.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 24 of the GLSL ES 1.00.17 spec: + * + * "Only one-dimensional arrays may be declared." + */ + + +uniform vec4 [1] an_array[1]; + +void main() +{ + gl_Position = an_array[0][0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert new file mode 100644 index 0000000..0c046f4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 24 of the GLSL ES 1.00.17 spec: + * + * "Only one-dimensional arrays may be declared." + */ + + +uniform vec4 an_array[1][1]; + +void main() +{ + gl_Position = an_array[0][0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert new file mode 100644 index 0000000..092150b --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert @@ -0,0 +1,23 @@ +/* [config] + * expect_result: fail + * glsles_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The arithmetic binary operators add (+), subtract (-), multiply (*), + * and divide (/) operate on integer and floating-point typed expressions + * (including vectors and matrices). The two operands must be of the same + * type or one can be a scalar float and the other a float vector or matrix + * or one can be a scalar integer and the other an integer vector." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + vec4 c[2] = a * b; + gl_Position = c[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-implicit-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-implicit-size.vert new file mode 100644 index 0000000..548c2e5 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-implicit-size.vert @@ -0,0 +1,28 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 48 GLSL ES 1.00.17 spec: + * + * "The equality operations equal (==) and not equal (!=) operate on all + * types execpt arrays, structures containing arrays...." + * + * Further "For vectors, matricies, and structures, all components of + * the operands must be equal for the operands to be considered equal." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + vec4 c[]; + + // Implicitly size c to match a and b. + c[0] = b[0]; + c[1] = b[2]; + + gl_Position = vec4(a != c); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-matrix.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-matrix.vert new file mode 100644 index 0000000..15f2938 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-matrix.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 48 GLSL ES 1.00.17 spec: + * + * "The equality operations equal (==) and not equal (!=) operate on all + * types execpt arrays, structures containing arrays...." + * + * Further "For vectors, matricies, and structures, all components of + * the operands must be equal for the operands to be considered equal." + */ + + +uniform vec4 a[4]; +uniform mat4 b; + +void main() +{ + gl_Position = vec4(a != b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-base-type.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-base-type.vert new file mode 100644 index 0000000..6cd21d4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-base-type.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 48 GLSL ES 1.00.17 spec: + * + * "The equality operations equal (==) and not equal (!=) operate on all + * types execpt arrays, structures containing arrays...." + * + * Further "For vectors, matricies, and structures, all components of + * the operands must be equal for the operands to be considered equal." + */ + + +uniform vec4 a[2]; +uniform vec3 b[2]; // Note the differing base type + +void main() +{ + gl_Position = vec4(a != b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-size.vert new file mode 100644 index 0000000..707babd --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-size.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 48 GLSL ES 1.00.17 spec: + * + * "The equality operations equal (==) and not equal (!=) operate on all + * types execpt arrays, structures containing arrays...." + * + * Further "For vectors, matricies, and structures, all components of + * the operands must be equal for the operands to be considered equal." + */ + + +uniform vec4 a[2]; +uniform vec4 b[3]; // Note the differing size + +void main() +{ + gl_Position = vec4(a != b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-vertor.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-vertor.vert new file mode 100644 index 0000000..a94152b --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-vertor.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 48 GLSL ES 1.00.17 spec: + * + * "The equality operations equal (==) and not equal (!=) operate on all + * types execpt arrays, structures containing arrays...." + * + * Further "For vectors, matricies, and structures, all components of + * the operands must be equal for the operands to be considered equal." + */ + + +uniform float a[4]; +uniform vec4 b; + +void main() +{ + gl_Position = vec4(a != b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal.vert new file mode 100644 index 0000000..208c169 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * Page 48 GLSL ES 1.00.17 spec: + * + * "The equality operations equal (==) and not equal (!=) operate on all + * types execpt arrays, structures containing arrays...." + * + * Further "For vectors, matricies, and structures, all components of + * the operands must be equal for the operands to be considered equal." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = vec4(a != b); +}