OpenGL: Don't use glad to load OpenGL entrypoints

This makes the OpenGL entry points loaded at Adapter creation from the
getProcAddress passed in the DiscoveryOptions and update all GL calls in
the backend to go through the new OpenGLFunctions object.

A code generator is added that generates the function loader and list of
GL procs from Khronos' gl.xml file but we can't get rid of glad yet
because it is used to have the PROC typedefs and enum values.

BUG=dawn:165

Change-Id: I2a583d79752f55877fa4190846f5be16cf91651a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7983
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Corentin Wallez
2019-06-13 10:22:32 +00:00
committed by Commit Bot service account
parent 87ab2f96d9
commit df69f24824
22 changed files with 51252 additions and 286 deletions

View File

@@ -44,7 +44,7 @@ import jinja2
# A custom Jinja2 template loader that removes the extra indentation
# of the template blocks so that the output is correctly indented
class PreprocessingLoader(jinja2.BaseLoader):
class _PreprocessingLoader(jinja2.BaseLoader):
def __init__(self, path):
self.path = path
@@ -93,7 +93,7 @@ class PreprocessingLoader(jinja2.BaseLoader):
_FileOutput = namedtuple('FileOutput', ['name', 'content'])
def _do_renders(renders, template_dir):
loader = PreprocessingLoader(template_dir)
loader = _PreprocessingLoader(template_dir)
env = jinja2.Environment(loader=loader, lstrip_blocks=True, trim_blocks=True, line_comment_prefix='//*')
def do_assert(expr):