From patchwork Thu Apr 18 15:07:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 16246 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f197.google.com (mail-ye0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8FE1723974 for ; Thu, 18 Apr 2013 15:09:09 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q1sf4209581yen.8 for ; Thu, 18 Apr 2013 08:08:32 -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 :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=WdiTjUmu2+736eC0V8MRv9egx3vwymplGh17aBqmUDg=; b=RyPTDgmq6+HDyufPEf9ABgGEXn0NE+sDeOzUFsoHOSwsVzTkg9mN8KysoBGge62yxw dMmXbJxuW/wsST4itUOAAvI3CWrPmHeWTJWlzH3RSRkWQpCO6V4YzODgW3wtQmAICO+o UWe24AWDl7Lt76prnMFSLN+4PIBFwvusy4ngc7FEKLpv2H/fPWxE1k5PK2MDNynUVNnD E2eq5bLwudfQ6vkzOmLMvZ3aAOF5pk+Y0mAq7l4mB+8zYrICDRvp1OGyp0dJx+iAGMy5 q1bhakwLPX/JVcLxEYgGTyK85Pe+DOlOtGErQi6YUbItxfAqXaxRBhiWGnp7F50ht93t 6VXw== X-Received: by 10.52.69.42 with SMTP id b10mr3652431vdu.5.1366297711649; Thu, 18 Apr 2013 08:08:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.117.101 with SMTP id kd5ls1576175qeb.45.gmail; Thu, 18 Apr 2013 08:08:31 -0700 (PDT) X-Received: by 10.52.69.179 with SMTP id f19mr7199514vdu.93.1366297711228; Thu, 18 Apr 2013 08:08:31 -0700 (PDT) Received: from mail-vb0-x235.google.com (mail-vb0-x235.google.com [2607:f8b0:400c:c02::235]) by mx.google.com with ESMTPS id e5si6808691vcu.42.2013.04.18.08.08.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 08:08:31 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::235; Received: by mail-vb0-f53.google.com with SMTP id i3so2477908vbh.40 for ; Thu, 18 Apr 2013 08:08:31 -0700 (PDT) X-Received: by 10.52.228.71 with SMTP id sg7mr7037146vdc.51.1366297711031; Thu, 18 Apr 2013 08:08:31 -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 nf2csp127948veb; Thu, 18 Apr 2013 08:08:30 -0700 (PDT) X-Received: by 10.50.212.105 with SMTP id nj9mr67537igc.17.1366297709989; Thu, 18 Apr 2013 08:08:29 -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 xr9si11395135icb.70.2013.04.18.08.08.29 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 08:08:29 -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 bn7so1293518ieb.13 for ; Thu, 18 Apr 2013 08:08:29 -0700 (PDT) X-Received: by 10.50.6.35 with SMTP id x3mr68558igx.85.1366297709565; Thu, 18 Apr 2013 08:08:29 -0700 (PDT) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPS id n7sm25651096igb.9.2013.04.18.08.08.27 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 08:08:28 -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: Thu, 18 Apr 2013 10:07:56 -0500 Message-Id: <1366297677-6992-1-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQnSp62HBZZOYUJsdufeAXWp0hc655dkwVbdM9k52mE4miwIcY3Zzv2wfM7NVeaRs+jhATcv X-Original-Sender: tom.gall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::235 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-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