Commit 2114fcf2 by Jamie Madill Committed by Commit Bot

More cleanups to run_code_generation.

Moves some include definition blocks into constants. Also fixes a small case error in the capture headers. Bug: angleproject:2621 Change-Id: I0e5eadcfd8e16969f3502339f58dbf13eb53f43c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2555860Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent f60823d3
......@@ -8,7 +8,7 @@
"scripts/entry_point_packed_gl_enums.json":
"846be5dc8cb36076207699b025633fcc",
"scripts/generate_entry_points.py":
"4fa24b51c640b48c203924e5af331f44",
"50fe62b18f729613a66b7343737db188",
"scripts/gl.xml":
"f66967f3f3d696b5d8306fd80bbd49a8",
"scripts/gl_angle_ext.xml":
......@@ -94,7 +94,7 @@
"src/libANGLE/capture_gles_ext_autogen.cpp":
"25fbe0477efc993f0b099a94aec01d71",
"src/libANGLE/capture_gles_ext_autogen.h":
"fe9dea1c92340c144299530b8e96fe3c",
"d2e205204a7a4dd22e953398503506f0",
"src/libANGLE/frame_capture_replay_autogen.cpp":
"09901bfdd8b16c9e888380179b53aa7a",
"src/libANGLE/frame_capture_utils_autogen.cpp":
......
......@@ -326,11 +326,11 @@ TEMPLATE_CAPTURE_HEADER = """\
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// capture_gles_{annotation}_autogen.h:
// capture_gles_{annotation_lower}_autogen.h:
// Capture functions for the OpenGL ES {comment} entry points.
#ifndef LIBANGLE_CAPTURE_GLES_{annotation}_AUTOGEN_H_
#define LIBANGLE_CAPTURE_GLES_{annotation}_AUTOGEN_H_
#ifndef LIBANGLE_CAPTURE_GLES_{annotation_upper}_AUTOGEN_H_
#define LIBANGLE_CAPTURE_GLES_{annotation_upper}_AUTOGEN_H_
#include "common/PackedEnums.h"
#include "libANGLE/FrameCapture.h"
......@@ -340,7 +340,7 @@ namespace gl
{prototypes}
}} // namespace gl
#endif // LIBANGLE_CAPTURE_GLES_{annotation}_AUTOGEN_H_
#endif // LIBANGLE_CAPTURE_GLES_{annotation_upper}_AUTOGEN_H_
"""
TEMPLATE_CAPTURE_SOURCE = """\
......@@ -555,6 +555,28 @@ TEMPLATE_SOURCES_INCLUDES = """\
#include "libGLESv2/global_state.h"
"""
GLES_EXT_HEADER_INCLUDES = TEMPLATE_HEADER_INCLUDES.format(
major="", minor="") + """
#include <GLES/glext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES3/gl32.h>
"""
GLES_EXT_SOURCE_INCLUDES = TEMPLATE_SOURCES_INCLUDES.format(
header_version="gles_ext", validation_header_version="ESEXT") + """
#include "libANGLE/capture_gles_1_0_autogen.h"
#include "libANGLE/capture_gles_2_0_autogen.h"
#include "libANGLE/capture_gles_3_0_autogen.h"
#include "libANGLE/capture_gles_3_1_autogen.h"
#include "libANGLE/capture_gles_3_2_autogen.h"
#include "libANGLE/validationES1.h"
#include "libANGLE/validationES2.h"
#include "libANGLE/validationES3.h"
#include "libANGLE/validationES31.h"
#include "libANGLE/validationES32.h"
"""
TEMPLATE_HEADER_INCLUDES_GL32 = """#include <export.h>
#include "angle_gl.h"
......@@ -1580,7 +1602,8 @@ def write_capture_header(annotation, comment, protos, capture_pointer_funcs):
content = TEMPLATE_CAPTURE_HEADER.format(
script_name=os.path.basename(sys.argv[0]),
data_source_name="gl.xml and gl_angle_ext.xml",
annotation=annotation,
annotation_lower=annotation.lower(),
annotation_upper=annotation.upper(),
comment=comment,
prototypes="\n".join(["\n// Method Captures\n"] + protos + ["\n// Parameter Captures\n"] +
capture_pointer_funcs))
......@@ -2459,35 +2482,12 @@ def main():
libgl_ep_exports += get_exports(wgl_commands)
header_includes = TEMPLATE_HEADER_INCLUDES.format(major="", minor="")
header_includes += """
#include <GLES/glext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES3/gl32.h>
"""
source_includes = TEMPLATE_SOURCES_INCLUDES.format(
header_version="gles_ext", validation_header_version="ESEXT")
source_includes += """
#include "libANGLE/capture_gles_1_0_autogen.h"
#include "libANGLE/capture_gles_2_0_autogen.h"
#include "libANGLE/capture_gles_3_0_autogen.h"
#include "libANGLE/capture_gles_3_1_autogen.h"
#include "libANGLE/capture_gles_3_2_autogen.h"
#include "libANGLE/validationES1.h"
#include "libANGLE/validationES2.h"
#include "libANGLE/validationES3.h"
#include "libANGLE/validationES31.h"
#include "libANGLE/validationES32.h"
"""
write_file("gles_ext", "GLES extension", TEMPLATE_ENTRY_POINT_HEADER,
"\n".join([item for item in extension_decls]), "h", header_includes, "libGLESv2",
"gl.xml and gl_angle_ext.xml", "namespace gl")
"\n".join([item for item in extension_decls]), "h", GLES_EXT_HEADER_INCLUDES,
"libGLESv2", "gl.xml and gl_angle_ext.xml", "namespace gl")
write_file("gles_ext", "GLES extension", TEMPLATE_ENTRY_POINT_SOURCE,
"\n".join([item for item in extension_defs]), "cpp", source_includes, "libGLESv2",
"gl.xml and gl_angle_ext.xml", "namespace gl")
"\n".join([item for item in extension_defs]), "cpp", GLES_EXT_SOURCE_INCLUDES,
"libGLESv2", "gl.xml and gl_angle_ext.xml", "namespace gl")
write_gl_validation_header("ESEXT", "ES extension", ext_validation_protos,
"gl.xml and gl_angle_ext.xml")
......
......@@ -8,8 +8,8 @@
// capture_gles_ext_autogen.h:
// Capture functions for the OpenGL ES extension entry points.
#ifndef LIBANGLE_CAPTURE_GLES_ext_AUTOGEN_H_
#define LIBANGLE_CAPTURE_GLES_ext_AUTOGEN_H_
#ifndef LIBANGLE_CAPTURE_GLES_EXT_AUTOGEN_H_
#define LIBANGLE_CAPTURE_GLES_EXT_AUTOGEN_H_
#include "common/PackedEnums.h"
#include "libANGLE/FrameCapture.h"
......@@ -4474,4 +4474,4 @@ void CaptureGenVertexArraysOES_arraysPacked(const State &glState,
angle::ParamCapture *paramCapture);
} // namespace gl
#endif // LIBANGLE_CAPTURE_GLES_ext_AUTOGEN_H_
#endif // LIBANGLE_CAPTURE_GLES_EXT_AUTOGEN_H_
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