From patchwork Sun Apr 21 06:09:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 16269 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 31F8024A1A for ; Sun, 21 Apr 2013 06:11:37 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id r16sf3719269ghr.10 for ; Sat, 20 Apr 2013 23:10:53 -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=grPbEbNlrR6pA7wbco0B+lklHRxrbnwzPpXarw+zqHI=; b=NPkOOMzObpy/HWI/UXJrTr6SaHRuD+xS4rO1W9zuxukCl3ebf4R+iRL91Td73/DlzR rTpVqe0VSO4k+qx/XZf+PNpvCvoVOVIshKQ8wGC4/S0kI0d6H5M2qtMYANol+MOEjotA utmsg0tu5zGkU+ZSO/onnyZgVccFjDeABIwJxSVyim8uGEAxSM4IOdhlc2u4USMhbocb HaQ0BkMIkDTghwdu8/fU0S+ZVpJc5TwJ5J9SvSdkz9tkTJ7Y3C6lnKlGhXmwTvcPmXGu PQdnKQNPB4ktynO4GS5O+H5EBaIGPI66xqeeXieNmYGxjYB21K1eULxHsrnaLnMso5nx WpSg== X-Received: by 10.224.215.194 with SMTP id hf2mr15741278qab.0.1366524653655; Sat, 20 Apr 2013 23:10:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.98 with SMTP id t2ls2740525qen.30.gmail; Sat, 20 Apr 2013 23:10:53 -0700 (PDT) X-Received: by 10.52.97.131 with SMTP id ea3mr13374428vdb.71.1366524653472; Sat, 20 Apr 2013 23:10:53 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id gr6si13393107vdc.26.2013.04.20.23.10.53 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Apr 2013 23:10:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 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.178; Received: by mail-vc0-f178.google.com with SMTP id ib11so2022996vcb.37 for ; Sat, 20 Apr 2013 23:10:53 -0700 (PDT) X-Received: by 10.58.48.166 with SMTP id m6mr2989445ven.59.1366524653330; Sat, 20 Apr 2013 23:10:53 -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 nf2csp32068veb; Sat, 20 Apr 2013 23:10:52 -0700 (PDT) X-Received: by 10.50.106.52 with SMTP id gr20mr1284475igb.109.1366524652556; Sat, 20 Apr 2013 23:10:52 -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 w6si9772732igp.53.2013.04.20.23.10.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Apr 2013 23:10:52 -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 tp5so3612674ieb.12 for ; Sat, 20 Apr 2013 23:10:52 -0700 (PDT) X-Received: by 10.50.110.104 with SMTP id hz8mr5393048igb.41.1366524652118; Sat, 20 Apr 2013 23:10:52 -0700 (PDT) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPSA id d4sm10509992igc.3.2013.04.20.23.10.50 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Apr 2013 23:10:51 -0700 (PDT) From: Tom Gall To: piglit@lists.freedesktop.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 2/8] variable-index-write.sh: extend to support glsl es 1.00 Date: Sun, 21 Apr 2013 01:09:37 -0500 Message-Id: <1366524583-25982-2-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366524583-25982-1-git-send-email-tom.gall@linaro.org> References: <1366524583-25982-1-git-send-email-tom.gall@linaro.org> X-Gm-Message-State: ALoCoQl7N2FF7eg/URmNTuovkezMWTUJ3FXEKJ31QCf9NYO5fTWANOE6+LthwcVAF0VDm5q/l4zQ X-Original-Sender: tom.gall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 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: , >From tests/spec/glsl-1.10 extend variable-index-write.sh so that it can also correctly generates variable index write tests that support glsl-es-1.00. 1.00 added as a valid parameter to generated tests for glsl-es-1.00. For 1.00 tests in the vertex shader an orthographic projection is applied since ortho during the test portion isn't supported on OpenGL ES. For 1.00 tests the fragent shader specifies default precision. For 1.00 tests emit in the [require] section the correct GLSL ES and GL ES settings. Signed-off-by: Tom Gall --- tests/spec/glsl-1.10/variable-index-write.sh | 67 +++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 6 deletions(-) diff --git a/tests/spec/glsl-1.10/variable-index-write.sh b/tests/spec/glsl-1.10/variable-index-write.sh index 96a4791..06802c4 100755 --- a/tests/spec/glsl-1.10/variable-index-write.sh +++ b/tests/spec/glsl-1.10/variable-index-write.sh @@ -177,6 +177,10 @@ function emit_fs fi echo "[fragment shader]" + if [ $v -eq 100 ]; then + echo "precision highp float;" + echo "precision highp int;" + fi emit_globals $* @@ -207,14 +211,24 @@ function emit_test_vectors index_value=$4 col=$5 value_type=$6 + v=${version/./} - cat <= ${version}" + if [ "$v" -eq 100 ]; then + echo "GLSL ES >= ${version}" + echo "GL ES >= 2.0" + else + echo "GLSL >= ${version}" + fi echo echo "[vertex shader]" - echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }" + if [ "$v" -eq 100 ]; then + echo "attribute vec4 vertex;" + echo "mat4 projection = mat4(" + echo " 2.0/250.0, 0.0, 0.0, -1.0," + echo " 0.0, 2.0/250.0, 0.0, -1.0," + echo " 0.0, 0.0, -1.0, 0.0," + echo " 0.0, 0.0, 0.0, 1.0);" + echo + echo "void main()" + echo "{" + echo " gl_Position = vertex;" + echo " gl_Position *= projection;" + echo "}" + else + echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }" + fi echo emit_fs $* @@ -342,20 +378,39 @@ function emit_vs_wr_test matrix_dim=$1 array_dim=$2 mode=$3 + v=${version/./} echo "# Test generated by:" echo "# ${cmd}" echo echo "[require]" - echo "GLSL >= ${version}" + if [ "$v" -eq 100 ]; then + echo "GLSL ES >= ${version}" + echo "GL ES >= 2.0" + else + echo "GLSL >= ${version}" + fi echo echo "[vertex shader]" + if [ "$v" -eq 100 ]; then + echo "attribute vec4 vertex;" + echo "mat4 projection = mat4(" + echo " 2.0/250.0, 0.0, 0.0, -1.0," + echo " 0.0, 2.0/250.0, 0.0, -1.0," + echo " 0.0, 0.0, -1.0, 0.0," + echo " 0.0, 0.0, 0.0, 1.0);" + fi emit_globals $* echo "void main()" echo "{" - echo " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;" + if [ "$v" -eq 100 ]; then + echo " gl_Position = vertex;" + echo " gl_Position *= projection;" + else + echo " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;" + fi echo emit_set_matrix $* @@ -387,7 +442,7 @@ if [ "x$1" = "x" ]; then version="1.10" else case "$1" in - 1.[12]0) version="$1";; + 1.[012]0) version="$1";; *) echo "Bogus GLSL version \"$1\" specified." exit 1