From patchwork Wed Mar 20 22:15:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 15446 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C222E23E39 for ; Wed, 20 Mar 2013 22:16:01 +0000 (UTC) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by fiordland.canonical.com (Postfix) with ESMTP id 36862A186C2 for ; Wed, 20 Mar 2013 22:16:01 +0000 (UTC) Received: by mail-vb0-f48.google.com with SMTP id fc21so1442698vbb.7 for ; Wed, 20 Mar 2013 15:16:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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; bh=grPbEbNlrR6pA7wbco0B+lklHRxrbnwzPpXarw+zqHI=; b=RHhQmJWUYN45NDDutsKHRgkuQDm8/MPKONMtoSxDxcRcG+8KE8ajzZf5wlC+86PnMD rB0HVc2XU+LAVnRVGHYz7cnLy6xZ/ZpayCedJXGCWnKsJlR64d88vkErSPabbSMclfop s/Y8NYp//uSVdSRTYWQKkX3pEdgusEwGJzXAe5nKi1ZOf//AyQdjA2JNCdflTR294kYD U+PDmZJGugr9k99iSe3cchJKWEazpMvGEWgADdBASfOEKTywe3vobtR44m3dLDzExJBa bj1sGvUT4vV2qLWo+N2Uu47Jk+Px54303OFCx1HNX6/vkRThMXugZ8EMnCHLnjrg/EDZ UJlA== X-Received: by 10.52.31.103 with SMTP id z7mr8798405vdh.56.1363817760665; Wed, 20 Mar 2013 15:16:00 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.233.198 with SMTP id ty6csp33987vec; Wed, 20 Mar 2013 15:15:59 -0700 (PDT) X-Received: by 10.42.154.9 with SMTP id o9mr3994385icw.32.1363817759676; Wed, 20 Mar 2013 15:15:59 -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 b13si5469612igq.6.2013.03.20.15.15.59 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Mar 2013 15:15:59 -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; Authentication-Results: mx.google.com; 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) smtp.mail=tom.gall@linaro.org Received: by mail-ie0-f181.google.com with SMTP id 17so2701496iea.40 for ; Wed, 20 Mar 2013 15:15:59 -0700 (PDT) X-Received: by 10.50.190.231 with SMTP id gt7mr484590igc.85.1363817759259; Wed, 20 Mar 2013 15:15:59 -0700 (PDT) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPS id xf4sm1026790igb.8.2013.03.20.15.15.57 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Mar 2013 15:15:57 -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: Wed, 20 Mar 2013 17:15:29 -0500 Message-Id: <1363817729-18168-2-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363817729-18168-1-git-send-email-tom.gall@linaro.org> References: <1363817729-18168-1-git-send-email-tom.gall@linaro.org> X-Gm-Message-State: ALoCoQmjltAgN1zRuZopSoKmpp8DdW7k4SyAfxDjUcpxbqyjgQdgklooOyzbnw8BNl1f19DR4Qyj >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 Reviewed-by: Stuart Abercrombie --- 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