From patchwork Thu Jan 17 23:09: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: 14106 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 A53F123E27 for ; Thu, 17 Jan 2013 23:09:43 +0000 (UTC) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by fiordland.canonical.com (Postfix) with ESMTP id 4140FA187C5 for ; Thu, 17 Jan 2013 23:09:43 +0000 (UTC) Received: by mail-vc0-f181.google.com with SMTP id d16so814112vcd.26 for ; Thu, 17 Jan 2013 15:09:42 -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=IKgEtBmrTCpYmFAtzkc11TEP2MczvbpjKC6kKq/J+WU=; b=iY4Xzg28Xk5YgElTFvqI5fB1+jg8nH5rzuH8XyU3peHhTjJFXtsIvb7XXMtM8pBjgP WYH2m51RCa2Rn6ecXH6/cm2YrA75MBgnlR3KiNnf7NaMA/PYJNJ0s1HAsYlRk46l2Bpi W3LYZjA9aun6JmfEUNySj7R16QlBp78F3ow8B1JAmkBEqwXPN4l6+dncfTDEPkYAbR01 CGGMo2Y1k+UC6YNrU3LKhkMhzJwf7hx90WTMRSfkGhsgjTvxHApfEHpg1W7s3Mdz3tJt WDnydrGRzt/ond5/wlConG3kMQ2dv/S/hQmYvZE6hZ8kqwHDttUzKkxUk5w2SUdVDEGv 2dDg== X-Received: by 10.220.218.197 with SMTP id hr5mr7366760vcb.8.1358464182708; Thu, 17 Jan 2013 15:09:42 -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.145.101 with SMTP id st5csp56336veb; Thu, 17 Jan 2013 15:09:42 -0800 (PST) X-Received: by 10.42.67.10 with SMTP id r10mr1702619ici.7.1358464181654; Thu, 17 Jan 2013 15:09:41 -0800 (PST) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx.google.com with ESMTPS id kh8si545890igc.71.2013.01.17.15.09.40 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Jan 2013 15:09:41 -0800 (PST) Received-SPF: neutral (google.com: 209.85.223.182 is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=209.85.223.182; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.223.182 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 s9so5603414iec.27 for ; Thu, 17 Jan 2013 15:09:40 -0800 (PST) X-Received: by 10.50.151.227 with SMTP id ut3mr483674igb.5.1358464180693; Thu, 17 Jan 2013 15:09:40 -0800 (PST) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPS id kp4sm524830igc.1.2013.01.17.15.09.38 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Jan 2013 15:09:39 -0800 (PST) From: Tom Gall To: patches@linaro.org Cc: Tom Gall Subject: [PATCH 1/2] shader_runner regression with gles Date: Thu, 17 Jan 2013 17:09:29 -0600 Message-Id: <1358464170-10234-1-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQk49xEcv/v4n5YLoPqvuq85L9bcukJSlWvjGfoqm8BjdKeciRaH9RfL98ifqa0nPS0omFXm Augment the parser that examines the shader_test file passed in with the test to determine which brand of shader_running to execute, shader_runner, shader_runner_gles2, etc. This fixes a bug where GLSL ES if first in the [required] section could match against GL after which the wrong shader_runner command would be used due to the wrong gl api being used. Last if plain GLSL is found, GL is presumed as the api. If GLSL ES is found, GL ES is presumed as the api. When dispatch is implemented for GLES all this can go away. Signed-off-by: Tom Gall --- framework/shader_test.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/framework/shader_test.py b/framework/shader_test.py index 335a6c1..4db291b 100755 --- a/framework/shader_test.py +++ b/framework/shader_test.py @@ -107,16 +107,18 @@ class ShaderTest(PlainExecTest): common = { 'cmp' : r'(<|<=|=|>=|>)', 'gl_version' : r'(\d.\d)', - 'gles2_version' : r'(2.\d\s+es)', - 'gles3_version' : r'(3.\d\s+es)', + 'gles2_version' : r'(2.\d\s)', + 'gles3_version' : r'(3.\d\s)', 'comment' : r'(#.*)', } cls.__re_require_header = re.compile(r'^\s*\[require\]\s*{comment}?$'.format(**common)) cls.__re_end_require_block = re.compile(r'^\s*\['.format(*common)) cls.__re_gl = re.compile(r'^\s*GL\s*{cmp}\s*{gl_version}\s*{comment}?$'.format(**common)) - cls.__re_gles2 = re.compile(r'^\s*GL\s*{cmp}\s*{gles2_version}\s*{comment}?$'.format(**common)) - cls.__re_gles3 = re.compile(r'^\s*GL\s*{cmp}\s*{gles3_version}\s*{comment}?$'.format(**common)) + cls.__re_gles2 = re.compile(r'^\s*GL ES\s*{cmp}\s*{gles2_version}\s*{comment}?$'.format(**common)) + cls.__re_gles3 = re.compile(r'^\s*GL ES\s*{cmp}\s*{gles3_version}\s*{comment}?$'.format(**common)) + cls.__re_glsl = re.compile(r'^\s*GLSL\s*{cmp}\s*{gl_version}\s*{comment}?$'.format(**common)) + cls.__re_glsles = re.compile(r'^\s*GLSL ES\s*{cmp}\s*{gl_version}\s*{comment}?$'.format(**common)) cls.__re_gl_unknown = re.compile(r'^\s*GL\s*{cmp}'.format(**common)) def __init__(self, shader_runner_args, run_standalone=False): @@ -174,15 +176,23 @@ class ShaderTest(PlainExecTest): else: continue elif parse_state == PARSE_FIND_GL_REQUIREMENT: - if cls.__re_gl.match(line) is not None: - self.__gl_api = ShaderTest.API_GL - return - elif cls.__re_gles2.match(line) is not None: + if cls.__re_gles2.match(line) is not None: self.__gl_api = ShaderTest.API_GLES2 return elif cls.__re_gles3.match(line) is not None: self.__gl_api = ShaderTest.API_GLES3 return + elif cls.__re_glsles.match(line) is not None: + if self.__gl_api is None: + self.__gl_api = ShaderTest.API_GLES2 + return + elif cls.__re_glsl.match(line) is not None: + if self.__gl_api is None: + self.__gl_api = ShaderTest.API_GL + return + elif cls.__re_gl.match(line) is not None: + self.__gl_api = ShaderTest.API_GL + return elif cls.__re_gl_unknown.match(line) is not None: self.__report_failure("Failed to parse GL requirement: " + line) self.__gl_api = ShaderTest.API_ERROR