Commit d4703d50 by Jamie Madill Committed by Commit Bot

Move packed enum code to common/

This makes it accessible in the utilities files. Bug: angleproject:2574 Bug: angleproject:2169 Change-Id: I0fdd34b4233e72b7534cb2b09f451539c1a394cd Reviewed-on: https://chromium-review.googlesource.com/1067110 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent 8a125ea7
...@@ -134,16 +134,16 @@ generators = { ...@@ -134,16 +134,16 @@ generators = {
}, },
'packed enum': { 'packed enum': {
'inputs': [ 'inputs': [
'src/libANGLE/packed_gl_enums.json', 'src/common/packed_gl_enums.json',
'src/libANGLE/packed_egl_enums.json', 'src/common/packed_egl_enums.json',
], ],
'outputs': [ 'outputs': [
'src/libANGLE/PackedEGLEnums_autogen.cpp', 'src/common/PackedEGLEnums_autogen.cpp',
'src/libANGLE/PackedEGLEnums_autogen.h', 'src/common/PackedEGLEnums_autogen.h',
'src/libANGLE/PackedGLEnums_autogen.cpp', 'src/common/PackedGLEnums_autogen.cpp',
'src/libANGLE/PackedGLEnums_autogen.h', 'src/common/PackedGLEnums_autogen.h',
], ],
'script': 'src/libANGLE/gen_packed_gl_enums.py', 'script': 'src/common/gen_packed_gl_enums.py',
}, },
'proc table': { 'proc table': {
'inputs': [ 'inputs': [
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// Implements ANGLE-specific enums classes for EGLenums and functions operating // Implements ANGLE-specific enums classes for EGLenums and functions operating
// on them. // on them.
#include "libANGLE/PackedEGLEnums_autogen.h" #include "common/PackedEGLEnums_autogen.h"
#include "common/debug.h" #include "common/debug.h"
namespace egl namespace egl
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
// Declares ANGLE-specific enums classes for EGLenums and functions operating // Declares ANGLE-specific enums classes for EGLenums and functions operating
// on them. // on them.
#ifndef LIBANGLE_PACKEDEGLENUMS_AUTOGEN_H_ #ifndef COMMON_PACKEDEGLENUMS_AUTOGEN_H_
#define LIBANGLE_PACKEDEGLENUMS_AUTOGEN_H_ #define COMMON_PACKEDEGLENUMS_AUTOGEN_H_
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
...@@ -40,4 +40,4 @@ EGLenum ToEGLenum(TextureFormat from); ...@@ -40,4 +40,4 @@ EGLenum ToEGLenum(TextureFormat from);
} // namespace egl } // namespace egl
#endif // LIBANGLE_PACKEDEGLENUMS_AUTOGEN_H_ #endif // COMMON_PACKEDEGLENUMS_AUTOGEN_H_
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// Declares ANGLE-specific enums classes for GLEnum and functions operating // Declares ANGLE-specific enums classes for GLEnum and functions operating
// on them. // on them.
#include "libANGLE/PackedEnums.h" #include "common/PackedEnums.h"
#include "common/utilities.h" #include "common/utilities.h"
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
// Declares ANGLE-specific enums classes for GLEnum and functions operating // Declares ANGLE-specific enums classes for GLEnum and functions operating
// on them. // on them.
#ifndef LIBANGLE_PACKEDGLENUMS_H_ #ifndef COMMON_PACKEDGLENUMS_H_
#define LIBANGLE_PACKEDGLENUMS_H_ #define COMMON_PACKEDGLENUMS_H_
#include "libANGLE/PackedEGLEnums_autogen.h" #include "common/PackedEGLEnums_autogen.h"
#include "libANGLE/PackedGLEnums_autogen.h" #include "common/PackedGLEnums_autogen.h"
#include <array> #include <array>
#include <bitset> #include <bitset>
...@@ -194,4 +194,4 @@ gl::TextureTarget EGLImageTargetToTextureTarget(EGLenum eglTarget); ...@@ -194,4 +194,4 @@ gl::TextureTarget EGLImageTargetToTextureTarget(EGLenum eglTarget);
gl::TextureType EGLTextureTargetToTextureType(EGLenum eglTarget); gl::TextureType EGLTextureTargetToTextureType(EGLenum eglTarget);
} // namespace egl_gl } // namespace egl_gl
#endif // LIBANGLE_PACKEDGLENUMS_H_ #endif // COMMON_PACKEDGLENUMS_H_
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// Implements ANGLE-specific enums classes for GLenums and functions operating // Implements ANGLE-specific enums classes for GLenums and functions operating
// on them. // on them.
#include "libANGLE/PackedGLEnums_autogen.h" #include "common/PackedGLEnums_autogen.h"
#include "common/debug.h" #include "common/debug.h"
namespace gl namespace gl
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
// Declares ANGLE-specific enums classes for GLenums and functions operating // Declares ANGLE-specific enums classes for GLenums and functions operating
// on them. // on them.
#ifndef LIBANGLE_PACKEDGLENUMS_AUTOGEN_H_ #ifndef COMMON_PACKEDGLENUMS_AUTOGEN_H_
#define LIBANGLE_PACKEDGLENUMS_AUTOGEN_H_ #define COMMON_PACKEDGLENUMS_AUTOGEN_H_
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
...@@ -395,4 +395,4 @@ GLenum ToGLenum(VertexArrayType from); ...@@ -395,4 +395,4 @@ GLenum ToGLenum(VertexArrayType from);
} // namespace gl } // namespace gl
#endif // LIBANGLE_PACKEDGLENUMS_AUTOGEN_H_ #endif // COMMON_PACKEDGLENUMS_AUTOGEN_H_
...@@ -71,8 +71,8 @@ header_template = """// GENERATED FILE - DO NOT EDIT. ...@@ -71,8 +71,8 @@ header_template = """// GENERATED FILE - DO NOT EDIT.
// Declares ANGLE-specific enums classes for {api_enum_name}s and functions operating // Declares ANGLE-specific enums classes for {api_enum_name}s and functions operating
// on them. // on them.
#ifndef LIBANGLE_{include_guard}_ #ifndef COMMON_{include_guard}_
#define LIBANGLE_{include_guard}_ #define COMMON_{include_guard}_
#include <angle_gl.h> #include <angle_gl.h>
#include <EGL/egl.h> #include <EGL/egl.h>
...@@ -88,7 +88,7 @@ Enum From{api_enum_name}({api_enum_name} from); ...@@ -88,7 +88,7 @@ Enum From{api_enum_name}({api_enum_name} from);
{content} {content}
}} // namespace {namespace} }} // namespace {namespace}
#endif // LIBANGLE_{include_guard}_ #endif // COMMON_{include_guard}_
""" """
enum_declaration_template = """ enum_declaration_template = """
...@@ -146,7 +146,7 @@ cpp_template = """// GENERATED FILE - DO NOT EDIT. ...@@ -146,7 +146,7 @@ cpp_template = """// GENERATED FILE - DO NOT EDIT.
// on them. // on them.
#include "common/debug.h" #include "common/debug.h"
#include "libANGLE/{header_name}" #include "common/{header_name}"
namespace {namespace} namespace {namespace}
{{ {{
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef LIBANGLE_ATTRIBUTEMAP_H_ #ifndef LIBANGLE_ATTRIBUTEMAP_H_
#define LIBANGLE_ATTRIBUTEMAP_H_ #define LIBANGLE_ATTRIBUTEMAP_H_
#include "libANGLE/PackedEnums.h" #include "common/PackedEnums.h"
#include <EGL/egl.h> #include <EGL/egl.h>
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
#ifndef LIBANGLE_BUFFER_H_ #ifndef LIBANGLE_BUFFER_H_
#define LIBANGLE_BUFFER_H_ #define LIBANGLE_BUFFER_H_
#include "common/PackedEnums.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Debug.h" #include "libANGLE/Debug.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/IndexRangeCache.h" #include "libANGLE/IndexRangeCache.h"
#include "libANGLE/PackedEnums.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
namespace rx namespace rx
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#define LIBANGLE_COMPILER_H_ #define LIBANGLE_COMPILER_H_
#include "GLSLANG/ShaderLang.h" #include "GLSLANG/ShaderLang.h"
#include "common/PackedEnums.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/PackedEnums.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
namespace rx namespace rx
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "angle_gl.h" #include "angle_gl.h"
#include "common/MemoryBuffer.h" #include "common/MemoryBuffer.h"
#include "common/PackedEnums.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Caps.h" #include "libANGLE/Caps.h"
#include "libANGLE/Constants.h" #include "libANGLE/Constants.h"
...@@ -22,7 +23,6 @@ ...@@ -22,7 +23,6 @@
#include "libANGLE/Context_gles_1_0_autogen.h" #include "libANGLE/Context_gles_1_0_autogen.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/HandleAllocator.h" #include "libANGLE/HandleAllocator.h"
#include "libANGLE/PackedEnums.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/ResourceMap.h" #include "libANGLE/ResourceMap.h"
#include "libANGLE/VertexAttribute.h" #include "libANGLE/VertexAttribute.h"
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#ifndef LIBANGLE_IMAGE_INDEX_H_ #ifndef LIBANGLE_IMAGE_INDEX_H_
#define LIBANGLE_IMAGE_INDEX_H_ #define LIBANGLE_IMAGE_INDEX_H_
#include "common/PackedEnums.h"
#include "common/mathutil.h" #include "common/mathutil.h"
#include "libANGLE/PackedEnums.h"
#include "angle_gl.h" #include "angle_gl.h"
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
#define LIBANGLE_UNIFORMLINKER_H_ #define LIBANGLE_UNIFORMLINKER_H_
#include "angle_gl.h" #include "angle_gl.h"
#include "common/PackedEnums.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/PackedEnums.h"
#include "libANGLE/VaryingPacking.h" #include "libANGLE/VaryingPacking.h"
#include <functional> #include <functional>
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
#ifndef LIBANGLE_QUERY_H_ #ifndef LIBANGLE_QUERY_H_
#define LIBANGLE_QUERY_H_ #define LIBANGLE_QUERY_H_
#include "common/PackedEnums.h"
#include "libANGLE/Debug.h" #include "libANGLE/Debug.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/PackedEnums.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "common/angleutils.h" #include "common/angleutils.h"
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
#include <EGL/egl.h> #include <EGL/egl.h>
#include "common/PackedEnums.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/AttributeMap.h" #include "libANGLE/AttributeMap.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/FramebufferAttachment.h" #include "libANGLE/FramebufferAttachment.h"
#include "libANGLE/PackedEnums.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
#include "libANGLE/renderer/SurfaceImpl.h" #include "libANGLE/renderer/SurfaceImpl.h"
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
#define LIBANGLE_ANGLETYPES_H_ #define LIBANGLE_ANGLETYPES_H_
#include "common/Color.h" #include "common/Color.h"
#include "common/PackedEnums.h"
#include "common/bitset_utils.h" #include "common/bitset_utils.h"
#include "common/vector_utils.h" #include "common/vector_utils.h"
#include "libANGLE/Constants.h" #include "libANGLE/Constants.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/PackedEnums.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include <stdint.h> #include <stdint.h>
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#define LIBANGLE_QUERYUTILS_H_ #define LIBANGLE_QUERYUTILS_H_
#include "angle_gl.h" #include "angle_gl.h"
#include "common/PackedEnums.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/PackedEnums.h"
#include <EGL/egl.h> #include <EGL/egl.h>
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
#ifndef LIBANGLE_RENDERER_BUFFERIMPL_H_ #ifndef LIBANGLE_RENDERER_BUFFERIMPL_H_
#define LIBANGLE_RENDERER_BUFFERIMPL_H_ #define LIBANGLE_RENDERER_BUFFERIMPL_H_
#include "common/PackedEnums.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "common/mathutil.h" #include "common/mathutil.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/Observer.h" #include "libANGLE/Observer.h"
#include "libANGLE/PackedEnums.h"
#include <stdint.h> #include <stdint.h>
......
...@@ -9,10 +9,9 @@ ...@@ -9,10 +9,9 @@
#ifndef LIBANGLE_RENDERER_QUERYIMPL_H_ #ifndef LIBANGLE_RENDERER_QUERYIMPL_H_
#define LIBANGLE_RENDERER_QUERYIMPL_H_ #define LIBANGLE_RENDERER_QUERYIMPL_H_
#include "common/PackedEnums.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/PackedEnums.h"
namespace rx namespace rx
{ {
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
#include "common/debug.h" #include "common/debug.h"
#include "common/PackedEnums.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/PackedEnums.h"
namespace gl namespace gl
{ {
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
#ifndef LIBANGLE_RENDERER_D3D_D3D9_BLIT9_H_ #ifndef LIBANGLE_RENDERER_D3D_D3D9_BLIT9_H_
#define LIBANGLE_RENDERER_D3D_D3D9_BLIT9_H_ #define LIBANGLE_RENDERER_D3D_D3D9_BLIT9_H_
#include "common/PackedEnums.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/PackedEnums.h"
namespace gl namespace gl
{ {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef LIBANGLE_RENDERER_VULKAN_VK_INTERNAL_SHADERS_H_ #ifndef LIBANGLE_RENDERER_VULKAN_VK_INTERNAL_SHADERS_H_
#define LIBANGLE_RENDERER_VULKAN_VK_INTERNAL_SHADERS_H_ #define LIBANGLE_RENDERER_VULKAN_VK_INTERNAL_SHADERS_H_
#include "libANGLE/PackedEnums.h" #include "common/PackedEnums.h"
#include "libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h" #include "libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h"
#include "libANGLE/renderer/vulkan/vk_utils.h" #include "libANGLE/renderer/vulkan/vk_utils.h"
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
#include <vulkan/vulkan.h> #include <vulkan/vulkan.h>
#include "common/Optional.h" #include "common/Optional.h"
#include "common/PackedEnums.h"
#include "common/debug.h" #include "common/debug.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/Observer.h" #include "libANGLE/Observer.h"
#include "libANGLE/PackedEnums.h"
#include "libANGLE/renderer/renderer_utils.h" #include "libANGLE/renderer/renderer_utils.h"
#define ANGLE_GL_OBJECTS_X(PROC) \ #define ANGLE_GL_OBJECTS_X(PROC) \
......
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
#ifndef LIBANGLE_VALIDATION_ES_H_ #ifndef LIBANGLE_VALIDATION_ES_H_
#define LIBANGLE_VALIDATION_ES_H_ #define LIBANGLE_VALIDATION_ES_H_
#include "common/PackedEnums.h"
#include "common/mathutil.h" #include "common/mathutil.h"
#include "libANGLE/Context.h" #include "libANGLE/Context.h"
#include "libANGLE/Framebuffer.h" #include "libANGLE/Framebuffer.h"
#include "libANGLE/PackedEnums.h"
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES3/gl3.h> #include <GLES3/gl3.h>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef LIBANGLE_VALIDATION_ES2_H_ #ifndef LIBANGLE_VALIDATION_ES2_H_
#define LIBANGLE_VALIDATION_ES2_H_ #define LIBANGLE_VALIDATION_ES2_H_
#include "libANGLE/PackedEnums.h" #include "common/PackedEnums.h"
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef LIBANGLE_VALIDATION_ES3_H_ #ifndef LIBANGLE_VALIDATION_ES3_H_
#define LIBANGLE_VALIDATION_ES3_H_ #define LIBANGLE_VALIDATION_ES3_H_
#include "libANGLE/PackedEnums.h" #include "common/PackedEnums.h"
#include <GLES3/gl3.h> #include <GLES3/gl3.h>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef LIBANGLE_VALIDATION_ES31_H_ #ifndef LIBANGLE_VALIDATION_ES31_H_
#define LIBANGLE_VALIDATION_ES31_H_ #define LIBANGLE_VALIDATION_ES31_H_
#include "libANGLE/PackedEnums.h" #include "common/PackedEnums.h"
#include <GLES3/gl31.h> #include <GLES3/gl31.h>
......
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
'common/MemoryBuffer.cpp', 'common/MemoryBuffer.cpp',
'common/MemoryBuffer.h', 'common/MemoryBuffer.h',
'common/Optional.h', 'common/Optional.h',
'common/PackedEGLEnums_autogen.cpp',
'common/PackedEGLEnums_autogen.h',
'common/PackedEnums.cpp',
'common/PackedEnums.h',
'common/PackedGLEnums_autogen.cpp',
'common/PackedGLEnums_autogen.h',
'common/aligned_memory.cpp', 'common/aligned_memory.cpp',
'common/aligned_memory.h', 'common/aligned_memory.h',
'common/angleutils.cpp', 'common/angleutils.cpp',
...@@ -191,12 +197,6 @@ ...@@ -191,12 +197,6 @@
'libANGLE/MemoryProgramCache.h', 'libANGLE/MemoryProgramCache.h',
'libANGLE/Observer.cpp', 'libANGLE/Observer.cpp',
'libANGLE/Observer.h', 'libANGLE/Observer.h',
'libANGLE/PackedEGLEnums_autogen.cpp',
'libANGLE/PackedEGLEnums_autogen.h',
'libANGLE/PackedEnums.cpp',
'libANGLE/PackedEnums.h',
'libANGLE/PackedGLEnums_autogen.cpp',
'libANGLE/PackedGLEnums_autogen.h',
'libANGLE/Path.h', 'libANGLE/Path.h',
'libANGLE/Path.cpp', 'libANGLE/Path.cpp',
'libANGLE/Platform.cpp', 'libANGLE/Platform.cpp',
......
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