Commit 4605dce8 authored by Sunny Sachanandani's avatar Sunny Sachanandani Committed by Commit Bot

gpu: Print error when command buffer function can't be parsed.

Useful for figuring out what went wrong.

R=piman
BUG=NONE

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Iee7ff46f8550131b6090085decef8dc21a53a9b1
Reviewed-on: https://chromium-review.googlesource.com/737063Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512711}
parent 83221ad0
......@@ -9949,7 +9949,9 @@ def CreateArg(arg_string):
class GLGenerator(object):
"""A class to generate GL command buffers."""
_function_re = re.compile(r'GL_APICALL(.*?)GL_APIENTRY (.*?) \((.*?)\);')
_whitespace_re = re.compile(r'^\w*$')
_comment_re = re.compile(r'^//.*$')
_function_re = re.compile(r'^GL_APICALL(.*?)GL_APIENTRY (.*?) \((.*?)\);$')
def __init__(self, verbose):
self.original_functions = []
......@@ -9996,6 +9998,8 @@ class GLGenerator(object):
with open(filename, "r") as f:
functions = f.read()
for line in functions.splitlines():
if self._whitespace_re.match(line) or self._comment_re.match(line):
continue
match = self._function_re.match(line)
if match:
func_name = match.group(2)[2:]
......@@ -10033,6 +10037,9 @@ class GLGenerator(object):
self.AddFunction(f)
else:
self.AddFunction(f)
else:
self.Error("Could not parse function: %s using regex: %s" %
(line, self._function_re.pattern))
self.Log("Auto Generated Functions : %d" %
len([f for f in self.functions if f.can_auto_generate or
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment