From patchwork Wed Mar 20 22:15:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 15445 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 CC4AB23E39 for ; Wed, 20 Mar 2013 22:15:58 +0000 (UTC) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by fiordland.canonical.com (Postfix) with ESMTP id 577EDA19CD3 for ; Wed, 20 Mar 2013 22:15:58 +0000 (UTC) Received: by mail-ve0-f176.google.com with SMTP id cz10so1870252veb.7 for ; Wed, 20 Mar 2013 15:15:57 -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 :x-gm-message-state; bh=ocpEMEOFEQ24P7Efe0FIFs9yjYH3FPSZj6ieBGD4OPg=; b=bcaBGJS+k+vRel5JcYWxAXgnEH1fR6GYlvQORVp3R3SJjzpFNi1OGS7DzzsnJNIbBy qcOqkGJZtgjFLDNPTOEwGVCLxAQmJY7vjSbvVS+AIPt+LfYfpfEwjmwA2MOuV64PIRx0 5wyhqtfTbfPFgkjiEDIx134BgC8+N13fRGyxLEsKnIcKzg9oBE+Tzrf7TG23leOHzkYr gjRFPfhG8mhB3Lu5JUb94UFO0ZxPPEAeO2dIC85YJKVfQ7yr7i2OG5u0yS/O6qnGeCAD GdbEd2Oiu8G40C7x4vEAyZBufbaxTdHleMx7OYhLs03NbbcxzJKPntcb5aVZ0j1A3OQ+ pEZA== X-Received: by 10.220.154.199 with SMTP id p7mr10423046vcw.46.1363817757810; Wed, 20 Mar 2013 15:15:57 -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 ty6csp33986vec; Wed, 20 Mar 2013 15:15:57 -0700 (PDT) X-Received: by 10.50.53.180 with SMTP id c20mr596755igp.15.1363817756590; Wed, 20 Mar 2013 15:15:56 -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 fv4si5808304igc.0.2013.03.20.15.15.55 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Mar 2013 15:15:56 -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 17so2701424iea.40 for ; Wed, 20 Mar 2013 15:15:55 -0700 (PDT) X-Received: by 10.50.88.233 with SMTP id bj9mr525910igb.55.1363817755000; Wed, 20 Mar 2013 15:15:55 -0700 (PDT) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPS id xf4sm1026790igb.8.2013.03.20.15.15.52 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Mar 2013 15:15:53 -0700 (PDT) From: Tom Gall To: piglit@lists.freedesktop.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 1/2] variable-index-read.sh: extend to support glsl es 1.00 Date: Wed, 20 Mar 2013 17:15:28 -0500 Message-Id: <1363817729-18168-1-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQlh2yOO2UrVerPzPUAowuBzStrSIs2Yd8qqLz1Y5NVlhwKi+NgTacPU9hd6Vchn+ExCJxyI >From tests/spec/glsl-1.10 extend variable-index-read.sh so that it can also correctly generates variable index read 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 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-read.sh | 54 ++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/tests/spec/glsl-1.10/variable-index-read.sh b/tests/spec/glsl-1.10/variable-index-read.sh index 80cb078..8fa2bc7 100755 --- a/tests/spec/glsl-1.10/variable-index-read.sh +++ b/tests/spec/glsl-1.10/variable-index-read.sh @@ -156,6 +156,7 @@ function emit_vs col=$5 expect_type=$6 do_compare=$7 + v=${version/./} if [ $array_dim -ne 0 ]; then idx="[${index_value}]" @@ -164,11 +165,24 @@ function emit_vs fi 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 # Only emit the code to set the matrix if the vertex shader is generating # varyings for a fragment shader or the matrix is in local storage and the @@ -215,8 +229,13 @@ emit_fs() col=$5 expect_type=$6 do_compare=$7 + v=${version/./} echo "[fragment shader]" + if [ $v -eq 100 ]; then + echo "precision highp float;" + echo "precision highp int;" + fi emit_globals $* echo "void main()" @@ -275,6 +294,7 @@ function emit_test_vectors index_value=$4 col=$5 expect_type=$6 + v=${version/./} # Optimizing GLSL linkers may reduce the size of the uniform array if tail # elements are not accessed. Shader runner will fail the test if one of @@ -283,16 +303,24 @@ function emit_test_vectors array_dim=$((index_value+1)) fi - cat <= $version" + if [ $v -eq 100 ]; then + echo "GLSL ES >= $version" + echo "GL ES >= 2.0" + else + echo "GLSL >= $version" + fi echo emit_vs $* 0 @@ -389,11 +424,18 @@ function emit_fs_rd_test # index in the fragment shader. function emit_vs_rd_test { + 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 emit_vs $* 1 @@ -408,7 +450,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