From patchwork Sun Apr 21 06:09:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 16268 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 33FDF24A1A for ; Sun, 21 Apr 2013 06:11:33 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id p7sf8355616qcq.2 for ; Sat, 20 Apr 2013 23:10:49 -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=ocpEMEOFEQ24P7Efe0FIFs9yjYH3FPSZj6ieBGD4OPg=; b=WRiTCXP8sPSI1MvotWtHuaJnMlpCcLuYmlsn85pXSdwa2LQEtqV24dkmsB1grM7CAH FUhssefAzC6FpsceC4jakpD2JTPDQsFNvzCj0eNlgAtiI3ltkbsAl9LEjw0R+lexqRIL p41Y1Kq5ApQgV/6E0Dce3MgSxRTFJUiGCvN4G0n3dPQtFONqk0BKlhK0OWV/ZTbBxgAm RQ+pF69iRZv6YudClIxOY/A4KqH/vDN6lAepSGwHGpgmmVLLR5tXGLfglOYmjRn2joGm pqvmBcl/QcgRPwBd2IX6OX4TSKTgsc8wjrvz3G4R4gy0TS14q3VCJR6ahqHHwbGVn2mj Yh5A== X-Received: by 10.236.126.165 with SMTP id b25mr11287559yhi.2.1366524649409; Sat, 20 Apr 2013 23:10:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.127.111 with SMTP id nf15ls2858541qeb.25.gmail; Sat, 20 Apr 2013 23:10:49 -0700 (PDT) X-Received: by 10.220.19.8 with SMTP id y8mr15991641vca.31.1366524649081; Sat, 20 Apr 2013 23:10:49 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id ec8si13352593vdb.150.2013.04.20.23.10.48 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Apr 2013 23:10:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 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.170; Received: by mail-vc0-f170.google.com with SMTP id hv10so1592279vcb.1 for ; Sat, 20 Apr 2013 23:10:48 -0700 (PDT) X-Received: by 10.52.34.168 with SMTP id a8mr13479314vdj.75.1366524648890; Sat, 20 Apr 2013 23:10:48 -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 nf2csp32065veb; Sat, 20 Apr 2013 23:10:48 -0700 (PDT) X-Received: by 10.50.170.36 with SMTP id aj4mr18531989igc.67.1366524647639; Sat, 20 Apr 2013 23:10:47 -0700 (PDT) Received: from mail-ia0-x231.google.com (mail-ia0-x231.google.com [2607:f8b0:4001:c02::231]) by mx.google.com with ESMTPS id hi5si9814383igc.14.2013.04.20.23.10.46 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Apr 2013 23:10:47 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:4001:c02::231 is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=2607:f8b0:4001:c02::231; Received: by mail-ia0-f177.google.com with SMTP id y26so1935838iab.22 for ; Sat, 20 Apr 2013 23:10:46 -0700 (PDT) X-Received: by 10.50.50.71 with SMTP id a7mr18679708igo.14.1366524646534; Sat, 20 Apr 2013 23:10:46 -0700 (PDT) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPSA id d4sm10509992igc.3.2013.04.20.23.10.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Apr 2013 23:10:44 -0700 (PDT) From: Tom Gall To: piglit@lists.freedesktop.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 1/8] variable-index-read.sh: extend to support glsl es 1.00 Date: Sun, 21 Apr 2013 01:09:36 -0500 Message-Id: <1366524583-25982-1-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQkn5k88Se2e0SenMhPmen49xzDbOkw1CLPr7mFUsR0+uzWfVQc3l+gQVffsvPLQUNzTiY06 X-Original-Sender: tom.gall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 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-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 Signed-off-by: Tom Gall 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