From d0ebcbac7a71be1d1cdf02fe71904d3d32e5a5ad Mon Sep 17 00:00:00 2001 From: Stephen White Date: Thu, 6 May 2021 18:34:14 +0000 Subject: [PATCH] Fixes for OpenGL loader generator. Add extensions to the appropriate (desktop or ES) LoadProc generation. Extensions have no removed_procs, so don't check for them. Bug: chromium:1205155 Change-Id: I705ef3fb700318f59fdbc6415fcf3909c62e39f4 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50180 Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng Commit-Queue: Stephen White --- generator/opengl_loader_generator.py | 3 +-- .../templates/opengl/OpenGLFunctionsBase.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/generator/opengl_loader_generator.py b/generator/opengl_loader_generator.py index 8a1d4bfe47..4f4f46f6d9 100644 --- a/generator/opengl_loader_generator.py +++ b/generator/opengl_loader_generator.py @@ -166,8 +166,7 @@ def compute_params(root, supported_extensions): for command in section.findall('./require/command'): proc_name = command.attrib['name'] assert all_procs[proc_name].alias == None - if proc_name not in removed_procs: - section_procs.append(all_procs[proc_name]) + section_procs.append(all_procs[proc_name]) section_enums = [] for enum in section.findall('./require/enum'): diff --git a/generator/templates/opengl/OpenGLFunctionsBase.cpp b/generator/templates/opengl/OpenGLFunctionsBase.cpp index 79fc5b1529..cc35dad37f 100644 --- a/generator/templates/opengl/OpenGLFunctionsBase.cpp +++ b/generator/templates/opengl/OpenGLFunctionsBase.cpp @@ -35,6 +35,14 @@ MaybeError OpenGLFunctionsBase::LoadOpenGLESProcs(GetProcAddress getProc, int ma } {% endfor %} + + {% for block in extension_gles_blocks %} + // {{block.extension}} + {% for proc in block.procs %} + DAWN_TRY(LoadProc(getProc, &{{proc.ProcName()}}, "{{proc.glProcName()}}")); + {% endfor %} + {% endfor %} + return {}; } @@ -48,6 +56,14 @@ MaybeError OpenGLFunctionsBase::LoadDesktopGLProcs(GetProcAddress getProc, int m } {% endfor %} + + {% for block in extension_desktop_gl_blocks %} + // {{block.extension}} + {% for proc in block.procs %} + DAWN_TRY(LoadProc(getProc, &{{proc.ProcName()}}, "{{proc.glProcName()}}")); + {% endfor %} + {% endfor %} + return {}; }