From patchwork Tue Feb 5 20:59:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 14575 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 C26F323E39 for ; Tue, 5 Feb 2013 21:00:21 +0000 (UTC) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by fiordland.canonical.com (Postfix) with ESMTP id 46A57A182BE for ; Tue, 5 Feb 2013 21:00:21 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so367491vba.13 for ; Tue, 05 Feb 2013 13:00:20 -0800 (PST) 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=ZXFZ/iZ1Im7yM9nZSY2KGfk75RDd2lwe5AAIGINUuWk=; b=PpQx8K2hNdHQOxvBZG4DNcTaeAMJmUZMR1RUnGM5JQHq7lQIGK5iRSJ08QyEl+ckGX VUZ8YInK5sRrniaixjrGfo7nXV7fbBlnQvHqNJBTETaDAotp0xiVHJRsiSLd4a88jVxV MwA7KLa1rs22m71sT7s+gnm6yJKwR2Cbc/MgTaVzLQyYWr0XFiOyVg88WACaxgdfzehV 8sbV8L0bgLCmKOyc5DdaQz1jE7kMSA7Oyye2EGzRMIe41jsZBVeLSz9lZq1/LqfGh2K5 Qs37t5y7h3mH4yXfsmeWwf8RRJpvUm07XmCUiJxJxaKYitnMxZkItSa33QT3I28OZhLD dsqA== X-Received: by 10.52.27.50 with SMTP id q18mr26236949vdg.20.1360098020753; Tue, 05 Feb 2013 13:00:20 -0800 (PST) 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.252.8 with SMTP id zo8csp147019vec; Tue, 5 Feb 2013 13:00:20 -0800 (PST) X-Received: by 10.42.100.193 with SMTP id b1mr24396977ico.55.1360098019986; Tue, 05 Feb 2013 13:00:19 -0800 (PST) Received: from mail-ie0-x236.google.com (ie-in-x0236.1e100.net [2607:f8b0:4001:c03::236]) by mx.google.com with ESMTPS id w10si22168325icv.22.2013.02.05.13.00.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Feb 2013 13:00:19 -0800 (PST) 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; Authentication-Results: mx.google.com; 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) smtp.mail=tom.gall@linaro.org Received: by mail-ie0-f182.google.com with SMTP id k14so866657iea.41 for ; Tue, 05 Feb 2013 13:00:19 -0800 (PST) X-Received: by 10.42.102.71 with SMTP id h7mr24256167ico.44.1360098019167; Tue, 05 Feb 2013 13:00:19 -0800 (PST) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPS id k5sm24475076igq.9.2013.02.05.13.00.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Feb 2013 13:00:18 -0800 (PST) From: Tom Gall To: piglit@lists.freedesktop.org Cc: patches@linaro.org, Tom Gall Subject: [PATCH 1/2] gen_builtin_test.py : add version 100 support Date: Tue, 5 Feb 2013 14:59:58 -0600 Message-Id: <1360098000-21267-1-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQlq98ln7UKrf/OOe4uUnuN1/R9olAVHPsVCXuHhp5n3xUj5hB05KTktyp1oORbWQQ5xf41B Adds support to emit builtin-functions-100.vert largely based on the 110 version. - Don't use gl_Vertex. - Create misc_parameter_100 which adds cross. Signed-off-by: Tom Gall --- tests/glslparsertest/glsl2/gen_builtin_test.py | 66 +++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/tests/glslparsertest/glsl2/gen_builtin_test.py b/tests/glslparsertest/glsl2/gen_builtin_test.py index e1e05e3..a4ca72f 100755 --- a/tests/glslparsertest/glsl2/gen_builtin_test.py +++ b/tests/glslparsertest/glsl2/gen_builtin_test.py @@ -1,5 +1,17 @@ #!/usr/bin/env python +misc_parameter_100 = [ + [ "genType", "mod", "genType", "float" ], + [ "genType", "min", "genType", "float" ], + [ "genType", "max", "genType", "float" ], + [ "genType", "clamp", "genType", "float", "float" ], + [ "genType", "mix", "genType", "genType", "float" ], + [ "genType", "step", "float", "genType" ], + [ "genType", "smoothstep", "float", "float", "genType" ], + [ "genType", "refract", "genType", "genType", "float" ], + [ "vec3", "cross", "vec3", "vec3" ], + ] + one_parameter_110 = [ "radians", "degrees", @@ -117,6 +129,55 @@ def emit_matrixCompMult(f, matTypes): f.write(" t_%s = matrixCompMult(u_%s, u_%s);\n" % (mat, mat, mat)) +def emit_100_tests(f): + f.write("/* PASS */\n#version 100\n\n") + f.write("uniform float u_float;\n") + + for s in ["vec", "ivec", "bvec", "mat"]: + for i in [2, 3, 4]: + f.write("uniform %s%d u_%s%d;\n" % (s, i, s, i)) + + f.write("""\nvoid main() +{ + gl_Position = vec4(0.0); + + float t_float = float(0.0); + bool t_bool = false;\n""") + + for i in [2, 3, 4]: + f.write(" vec%d t_vec%d = vec%d (0.0);\n" % (i, i, i)) + f.write(" bvec%d t_bvec%d = bvec%d(0.0);\n" % (i, i, i)) + f.write(" mat%d t_mat%d = mat%d (0.0);\n" % (i, i, i)) + + f.write("\n") + + for name in one_parameter_110: + for t in genType: + f.write(" t_%s += %s(u_%s);\n" % (t, name, t)) + + f.write("\n") + + for name in two_parameter_110: + for t in genType: + f.write(" t_%s += %s(u_%s, -u_%s);\n" % (t, name, t, t)) + + f.write("\n") + + for name in three_parameter_110: + for t in genType: + f.write(" t_%s += %s(u_%s, -u_%s, 11.7 * u_%s);\n" % + (t, name, t, t, t)) + + f.write("\n") + + emit_pattern_call(f, misc_parameter_100, genType) + emit_pattern_call(f, vec_parameter_110, vecType) + emit_pattern_call(f, bvec_parameter_110, bvecType) + emit_matrixCompMult(f, ["mat2", "mat3", "mat4"]) + + f.write("}\n") + + def emit_110_tests(f): f.write("/* PASS */\n#version 110\n\n") f.write("uniform float u_float;\n") @@ -248,6 +309,10 @@ def emit_120_tests(f): f.write("}\n") +f = open("builtin-functions-100.vert", "w") +emit_100_tests(f) +f.close() + f = open("builtin-functions-110.vert", "w") emit_110_tests(f) f.close() @@ -259,4 +324,3 @@ f.close() f = open("builtin-functions-120.vert", "w") emit_120_tests(f) f.close() -