From patchwork Thu Apr 18 15:07:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 16247 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f199.google.com (mail-gg0-f199.google.com [209.85.161.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9DB9E23974 for ; Thu, 18 Apr 2013 15:09:12 +0000 (UTC) Received: by mail-gg0-f199.google.com with SMTP id v2sf4130178ggc.2 for ; Thu, 18 Apr 2013 08:08:35 -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=vTe3UnIMfDn82iCFXBqr9vHj8ssno0h8Jq0K8Fzvwrk=; b=IR0chMiO6lqcYIaT1Ib5c0fPpgdStJusgfggDJ209yJAwv7Q1SUNVIfjD20z4496dS 2QAwGXPYOgJFt5zcSr4boFJnjtvCCW5pX/cj/Wyv7xVw8WMQdUm8nuF/GlXngOn5fc5o hM0vgQrLNB5UvD1+xTvSfPD7NipM7OpjeE30mG4jO2YnO2Df68ES9wa3ljywlNWHR7rr lVoRrwHGd8H20KnlEOb0dJADMXJuRMTnJb9/60/0L5OiHfreT/TQJFlzgbNaPP+zTmN1 hvzvs0Eq6yHWJSvbFVk9ijVMdG2VUtY5VFSWekbkD016O3eIjxwuOkrFVvX/QmoIDX2J qylg== X-Received: by 10.236.170.7 with SMTP id o7mr5680124yhl.1.1366297715015; Thu, 18 Apr 2013 08:08:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.16 with SMTP id z16ls1552267qem.26.gmail; Thu, 18 Apr 2013 08:08:34 -0700 (PDT) X-Received: by 10.52.99.67 with SMTP id eo3mr7323702vdb.21.1366297714871; Thu, 18 Apr 2013 08:08:34 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id gr6si6821328vdc.26.2013.04.18.08.08.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 08:08:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 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.182; Received: by mail-vc0-f182.google.com with SMTP id ht11so440193vcb.27 for ; Thu, 18 Apr 2013 08:08:34 -0700 (PDT) X-Received: by 10.220.242.73 with SMTP id lh9mr8406102vcb.49.1366297714673; Thu, 18 Apr 2013 08:08:34 -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 nf2csp127951veb; Thu, 18 Apr 2013 08:08:34 -0700 (PDT) X-Received: by 10.50.51.200 with SMTP id m8mr81417igo.52.1366297713788; Thu, 18 Apr 2013 08:08:33 -0700 (PDT) Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [2607:f8b0:4001:c03::236]) by mx.google.com with ESMTPS id e9si11412083icx.45.2013.04.18.08.08.33 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 08:08:33 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4001:c03::236 is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=2607:f8b0:4001:c03::236; Received: by mail-ie0-f182.google.com with SMTP id bn7so1301427ieb.27 for ; Thu, 18 Apr 2013 08:08:33 -0700 (PDT) X-Received: by 10.50.12.70 with SMTP id w6mr7215472igb.66.1366297713367; Thu, 18 Apr 2013 08:08:33 -0700 (PDT) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPS id n7sm25651096igb.9.2013.04.18.08.08.31 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 08:08:32 -0700 (PDT) From: Tom Gall To: piglit@lists.freedesktop.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 2/2] variable-index-write.sh: extend to support glsl es 1.00 Date: Thu, 18 Apr 2013 10:07:57 -0500 Message-Id: <1366297677-6992-2-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366297677-6992-1-git-send-email-tom.gall@linaro.org> References: <1366297677-6992-1-git-send-email-tom.gall@linaro.org> X-Gm-Message-State: ALoCoQlLuLwSlqGIoVp5zrrC5kLASjNokeloEGa8g2DIz02yndF4pLhm+/bydEEmFTb2WS/bsMlc X-Original-Sender: tom.gall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 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: , Please apply. Initially posted ~ a month ago. No negative feedback. >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