Hash :
c8c9a24a
Author :
Date :
2018-01-02T13:39:00
Entry Points: Refactor generator script. This cleans up some of the organization of the python generator. It will make the extension entry point generation simpler. It also changes the header guards to use more underscores, which produces a small diff. Also updates the copyright year in a few generated files. Bug: angleproject:2263 Change-Id: I42f061c24a6cfcd8328c56c57eaed9ca6c7bb293 Reviewed-on: https://chromium-review.googlesource.com/846306 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_packed_gl_enums.py using data from packed_gl_enums.json.
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// PackedGLEnums_autogen.cpp:
// Implements ANGLE-specific enums classes for GLEnum and functions operating
// on them.
#include "libANGLE/PackedGLEnums_autogen.h"
#include "common/debug.h"
namespace gl
{
template <>
BufferBinding FromGLenum<BufferBinding>(GLenum from)
{
switch (from)
{
case GL_ARRAY_BUFFER:
return BufferBinding::Array;
case GL_ATOMIC_COUNTER_BUFFER:
return BufferBinding::AtomicCounter;
case GL_COPY_READ_BUFFER:
return BufferBinding::CopyRead;
case GL_COPY_WRITE_BUFFER:
return BufferBinding::CopyWrite;
case GL_DISPATCH_INDIRECT_BUFFER:
return BufferBinding::DispatchIndirect;
case GL_DRAW_INDIRECT_BUFFER:
return BufferBinding::DrawIndirect;
case GL_ELEMENT_ARRAY_BUFFER:
return BufferBinding::ElementArray;
case GL_PIXEL_PACK_BUFFER:
return BufferBinding::PixelPack;
case GL_PIXEL_UNPACK_BUFFER:
return BufferBinding::PixelUnpack;
case GL_SHADER_STORAGE_BUFFER:
return BufferBinding::ShaderStorage;
case GL_TRANSFORM_FEEDBACK_BUFFER:
return BufferBinding::TransformFeedback;
case GL_UNIFORM_BUFFER:
return BufferBinding::Uniform;
default:
return BufferBinding::InvalidEnum;
}
}
GLenum ToGLenum(BufferBinding from)
{
switch (from)
{
case BufferBinding::Array:
return GL_ARRAY_BUFFER;
case BufferBinding::AtomicCounter:
return GL_ATOMIC_COUNTER_BUFFER;
case BufferBinding::CopyRead:
return GL_COPY_READ_BUFFER;
case BufferBinding::CopyWrite:
return GL_COPY_WRITE_BUFFER;
case BufferBinding::DispatchIndirect:
return GL_DISPATCH_INDIRECT_BUFFER;
case BufferBinding::DrawIndirect:
return GL_DRAW_INDIRECT_BUFFER;
case BufferBinding::ElementArray:
return GL_ELEMENT_ARRAY_BUFFER;
case BufferBinding::PixelPack:
return GL_PIXEL_PACK_BUFFER;
case BufferBinding::PixelUnpack:
return GL_PIXEL_UNPACK_BUFFER;
case BufferBinding::ShaderStorage:
return GL_SHADER_STORAGE_BUFFER;
case BufferBinding::TransformFeedback:
return GL_TRANSFORM_FEEDBACK_BUFFER;
case BufferBinding::Uniform:
return GL_UNIFORM_BUFFER;
default:
UNREACHABLE();
return GL_NONE;
}
}
template <>
BufferUsage FromGLenum<BufferUsage>(GLenum from)
{
switch (from)
{
case GL_DYNAMIC_COPY:
return BufferUsage::DynamicCopy;
case GL_DYNAMIC_DRAW:
return BufferUsage::DynamicDraw;
case GL_DYNAMIC_READ:
return BufferUsage::DynamicRead;
case GL_STATIC_COPY:
return BufferUsage::StaticCopy;
case GL_STATIC_DRAW:
return BufferUsage::StaticDraw;
case GL_STATIC_READ:
return BufferUsage::StaticRead;
case GL_STREAM_COPY:
return BufferUsage::StreamCopy;
case GL_STREAM_DRAW:
return BufferUsage::StreamDraw;
case GL_STREAM_READ:
return BufferUsage::StreamRead;
default:
return BufferUsage::InvalidEnum;
}
}
GLenum ToGLenum(BufferUsage from)
{
switch (from)
{
case BufferUsage::DynamicCopy:
return GL_DYNAMIC_COPY;
case BufferUsage::DynamicDraw:
return GL_DYNAMIC_DRAW;
case BufferUsage::DynamicRead:
return GL_DYNAMIC_READ;
case BufferUsage::StaticCopy:
return GL_STATIC_COPY;
case BufferUsage::StaticDraw:
return GL_STATIC_DRAW;
case BufferUsage::StaticRead:
return GL_STATIC_READ;
case BufferUsage::StreamCopy:
return GL_STREAM_COPY;
case BufferUsage::StreamDraw:
return GL_STREAM_DRAW;
case BufferUsage::StreamRead:
return GL_STREAM_READ;
default:
UNREACHABLE();
return GL_NONE;
}
}
template <>
CullFaceMode FromGLenum<CullFaceMode>(GLenum from)
{
switch (from)
{
case GL_BACK:
return CullFaceMode::Back;
case GL_FRONT:
return CullFaceMode::Front;
case GL_FRONT_AND_BACK:
return CullFaceMode::FrontAndBack;
default:
return CullFaceMode::InvalidEnum;
}
}
GLenum ToGLenum(CullFaceMode from)
{
switch (from)
{
case CullFaceMode::Back:
return GL_BACK;
case CullFaceMode::Front:
return GL_FRONT;
case CullFaceMode::FrontAndBack:
return GL_FRONT_AND_BACK;
default:
UNREACHABLE();
return GL_NONE;
}
}
} // namespace gl