// GENERATED FILE - DO NOT EDIT.
// Generated by gen_angle_format_table.py using data from angle_format_data.json
//
// Copyright 2016 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.
//
// ANGLE Format table:
//   Queries for typed format information from the ANGLE format enum.

#include "libANGLE/renderer/Format.h"

#include "image_util/copyimage.h"
#include "image_util/generatemip.h"
#include "image_util/loadimage.h"

namespace angle
{

// static
const Format &Format::Get(ID id)
{
    // clang-format off
    switch (id)
    {
        case ID::A8_UNORM:
        {
            static const Format info(ID::A8_UNORM,
                                     GL_ALPHA8_EXT,
                                     GL_ALPHA8_EXT,
                                     GenerateMip<A8>,
                                     ReadColor<A8, GLfloat>);
            return info;
        }
        case ID::B4G4R4A4_UNORM:
        {
            static const Format info(ID::B4G4R4A4_UNORM,
                                     GL_BGRA4_ANGLEX,
                                     GL_RGBA4,
                                     GenerateMip<A4R4G4B4>,
                                     ReadColor<A4R4G4B4, GLfloat>);
            return info;
        }
        case ID::B5G5R5A1_UNORM:
        {
            static const Format info(ID::B5G5R5A1_UNORM,
                                     GL_BGR5_A1_ANGLEX,
                                     GL_RGB5_A1,
                                     GenerateMip<A1R5G5B5>,
                                     ReadColor<A1R5G5B5, GLfloat>);
            return info;
        }
        case ID::B5G6R5_UNORM:
        {
            static const Format info(ID::B5G6R5_UNORM,
                                     GL_BGR565_ANGLEX,
                                     GL_RGB565,
                                     GenerateMip<B5G6R5>,
                                     ReadColor<B5G6R5, GLfloat>);
            return info;
        }
        case ID::B8G8R8A8_UNORM:
        {
            static const Format info(ID::B8G8R8A8_UNORM,
                                     GL_BGRA8_EXT,
                                     GL_BGRA8_EXT,
                                     GenerateMip<B8G8R8A8>,
                                     ReadColor<B8G8R8A8, GLfloat>);
            return info;
        }
        case ID::B8G8R8X8_UNORM:
        {
            static const Format info(ID::B8G8R8X8_UNORM,
                                     GL_BGRA8_EXT,
                                     GL_BGRA8_EXT,
                                     GenerateMip<B8G8R8X8>,
                                     ReadColor<B8G8R8X8, GLfloat>);
            return info;
        }
        case ID::BC1_UNORM:
        {
            static const Format info(ID::BC1_UNORM,
                                     GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
                                     GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
                                     nullptr,
                                     nullptr);
            return info;
        }
        case ID::BC2_UNORM:
        {
            static const Format info(ID::BC2_UNORM,
                                     GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE,
                                     GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE,
                                     nullptr,
                                     nullptr);
            return info;
        }
        case ID::BC3_UNORM:
        {
            static const Format info(ID::BC3_UNORM,
                                     GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE,
                                     GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE,
                                     nullptr,
                                     nullptr);
            return info;
        }
        case ID::D16_UNORM:
        {
            static const Format info(ID::D16_UNORM,
                                     GL_DEPTH_COMPONENT16,
                                     GL_DEPTH_COMPONENT16,
                                     nullptr,
                                     nullptr);
            return info;
        }
        case ID::D24_UNORM_S8_UINT:
        {
            static const Format info(ID::D24_UNORM_S8_UINT,
                                     GL_DEPTH24_STENCIL8_OES,
                                     GL_DEPTH24_STENCIL8_OES,
                                     nullptr,
                                     nullptr);
            return info;
        }
        case ID::D32_FLOAT:
        {
            static const Format info(ID::D32_FLOAT,
                                     GL_DEPTH_COMPONENT32F,
                                     GL_DEPTH_COMPONENT32F,
                                     nullptr,
                                     nullptr);
            return info;
        }
        case ID::D32_FLOAT_S8X24_UINT:
        {
            static const Format info(ID::D32_FLOAT_S8X24_UINT,
                                     GL_DEPTH32F_STENCIL8,
                                     GL_DEPTH32F_STENCIL8,
                                     nullptr,
                                     nullptr);
            return info;
        }
        case ID::D32_UNORM:
        {
            static const Format info(ID::D32_UNORM,
                                     GL_DEPTH_COMPONENT32_OES,
                                     GL_DEPTH_COMPONENT32_OES,
                                     nullptr,
                                     nullptr);
            return info;
        }
        case ID::L8A8_LUMA:
        {
            static const Format info(ID::L8A8_LUMA,
                                     GL_LUMINANCE8_ALPHA8_EXT,
                                     GL_LUMINANCE8_ALPHA8_EXT,
                                     GenerateMip<L8A8>,
                                     ReadColor<L8A8, GLfloat>);
            return info;
        }
        case ID::L8_LUMA:
        {
            static const Format info(ID::L8_LUMA,
                                     GL_LUMINANCE8_EXT,
                                     GL_LUMINANCE8_EXT,
                                     GenerateMip<L8>,
                                     ReadColor<L8, GLfloat>);
            return info;
        }
        case ID::NONE:
        {
            static const Format info(ID::NONE,
                                     GL_NONE,
                                     GL_NONE,
                                     nullptr,
                                     nullptr);
            return info;
        }
        case ID::R10G10B10A2_UINT:
        {
            static const Format info(ID::R10G10B10A2_UINT,
                                     GL_RGB10_A2UI,
                                     GL_RGB10_A2UI,
                                     GenerateMip<R10G10B10A2>,
                                     ReadColor<R10G10B10A2, GLuint>);
            return info;
        }
        case ID::R10G10B10A2_UNORM:
        {
            static const Format info(ID::R10G10B10A2_UNORM,
                                     GL_RGB10_A2,
                                     GL_RGB10_A2,
                                     GenerateMip<R10G10B10A2>,
                                     ReadColor<R10G10B10A2, GLfloat>);
            return info;
        }
        case ID::R11G11B10_FLOAT:
        {
            static const Format info(ID::R11G11B10_FLOAT,
                                     GL_R11F_G11F_B10F,
                                     GL_R11F_G11F_B10F,
                                     GenerateMip<R11G11B10F>,
                                     ReadColor<R11G11B10F, GLfloat>);
            return info;
        }
        case ID::R16G16B16A16_FLOAT:
        {
            static const Format info(ID::R16G16B16A16_FLOAT,
                                     GL_RGBA16F,
                                     GL_RGBA16F,
                                     GenerateMip<R16G16B16A16F>,
                                     ReadColor<R16G16B16A16F, GLfloat>);
            return info;
        }
        case ID::R16G16B16A16_SINT:
        {
            static const Format info(ID::R16G16B16A16_SINT,
                                     GL_RGBA16I,
                                     GL_RGBA16I,
                                     GenerateMip<R16G16B16A16S>,
                                     ReadColor<R16G16B16A16S, GLint>);
            return info;
        }
        case ID::R16G16B16A16_SNORM:
        {
            static const Format info(ID::R16G16B16A16_SNORM,
                                     GL_RGBA16_SNORM_EXT,
                                     GL_RGBA16_SNORM_EXT,
                                     GenerateMip<R16G16B16A16S>,
                                     ReadColor<R16G16B16A16S, GLfloat>);
            return info;
        }
        case ID::R16G16B16A16_UINT:
        {
            static const Format info(ID::R16G16B16A16_UINT,
                                     GL_RGBA16UI,
                                     GL_RGBA16UI,
                                     GenerateMip<R16G16B16A16>,
                                     ReadColor<R16G16B16A16, GLuint>);
            return info;
        }
        case ID::R16G16B16A16_UNORM:
        {
            static const Format info(ID::R16G16B16A16_UNORM,
                                     GL_RGBA16_EXT,
                                     GL_RGBA16_EXT,
                                     GenerateMip<R16G16B16A16>,
                                     ReadColor<R16G16B16A16, GLfloat>);
            return info;
        }
        case ID::R16G16_FLOAT:
        {
            static const Format info(ID::R16G16_FLOAT,
                                     GL_RG16F,
                                     GL_RG16F,
                                     GenerateMip<R16G16F>,
                                     ReadColor<R16G16F, GLfloat>);
            return info;
        }
        case ID::R16G16_SINT:
        {
            static const Format info(ID::R16G16_SINT,
                                     GL_RG16I,
                                     GL_RG16I,
                                     GenerateMip<R16G16S>,
                                     ReadColor<R16G16S, GLint>);
            return info;
        }
        case ID::R16G16_SNORM:
        {
            static const Format info(ID::R16G16_SNORM,
                                     GL_RG16_SNORM_EXT,
                                     GL_RG16_SNORM_EXT,
                                     GenerateMip<R16G16S>,
                                     ReadColor<R16G16S, GLfloat>);
            return info;
        }
        case ID::R16G16_UINT:
        {
            static const Format info(ID::R16G16_UINT,
                                     GL_RG16UI,
                                     GL_RG16UI,
                                     GenerateMip<R16G16>,
                                     ReadColor<R16G16, GLuint>);
            return info;
        }
        case ID::R16G16_UNORM:
        {
            static const Format info(ID::R16G16_UNORM,
                                     GL_RG16_EXT,
                                     GL_RG16_EXT,
                                     GenerateMip<R16G16>,
                                     ReadColor<R16G16, GLfloat>);
            return info;
        }
        case ID::R16_FLOAT:
        {
            static const Format info(ID::R16_FLOAT,
                                     GL_R16F,
                                     GL_R16F,
                                     GenerateMip<R16F>,
                                     ReadColor<R16F, GLfloat>);
            return info;
        }
        case ID::R16_SINT:
        {
            static const Format info(ID::R16_SINT,
                                     GL_R16I,
                                     GL_R16I,
                                     GenerateMip<R16S>,
                                     ReadColor<R16S, GLint>);
            return info;
        }
        case ID::R16_SNORM:
        {
            static const Format info(ID::R16_SNORM,
                                     GL_R16_SNORM_EXT,
                                     GL_R16_SNORM_EXT,
                                     GenerateMip<R16S>,
                                     ReadColor<R16S, GLfloat>);
            return info;
        }
        case ID::R16_UINT:
        {
            static const Format info(ID::R16_UINT,
                                     GL_R16UI,
                                     GL_R16UI,
                                     GenerateMip<R16>,
                                     ReadColor<R16, GLuint>);
            return info;
        }
        case ID::R16_UNORM:
        {
            static const Format info(ID::R16_UNORM,
                                     GL_R16_EXT,
                                     GL_R16_EXT,
                                     GenerateMip<R16>,
                                     ReadColor<R16, GLfloat>);
            return info;
        }
        case ID::R32G32B32A32_FLOAT:
        {
            static const Format info(ID::R32G32B32A32_FLOAT,
                                     GL_RGBA32F,
                                     GL_RGBA32F,
                                     GenerateMip<R32G32B32A32F>,
                                     ReadColor<R32G32B32A32F, GLfloat>);
            return info;
        }
        case ID::R32G32B32A32_SINT:
        {
            static const Format info(ID::R32G32B32A32_SINT,
                                     GL_RGBA32I,
                                     GL_RGBA32I,
                                     GenerateMip<R32G32B32A32S>,
                                     ReadColor<R32G32B32A32S, GLint>);
            return info;
        }
        case ID::R32G32B32A32_UINT:
        {
            static const Format info(ID::R32G32B32A32_UINT,
                                     GL_RGBA32UI,
                                     GL_RGBA32UI,
                                     GenerateMip<R32G32B32A32>,
                                     ReadColor<R32G32B32A32, GLuint>);
            return info;
        }
        case ID::R32G32_FLOAT:
        {
            static const Format info(ID::R32G32_FLOAT,
                                     GL_RG32F,
                                     GL_RG32F,
                                     GenerateMip<R32G32F>,
                                     ReadColor<R32G32F, GLfloat>);
            return info;
        }
        case ID::R32G32_SINT:
        {
            static const Format info(ID::R32G32_SINT,
                                     GL_RG32I,
                                     GL_RG32I,
                                     GenerateMip<R32G32S>,
                                     ReadColor<R32G32S, GLint>);
            return info;
        }
        case ID::R32G32_UINT:
        {
            static const Format info(ID::R32G32_UINT,
                                     GL_RG32UI,
                                     GL_RG32UI,
                                     GenerateMip<R32G32>,
                                     ReadColor<R32G32, GLuint>);
            return info;
        }
        case ID::R32_FLOAT:
        {
            static const Format info(ID::R32_FLOAT,
                                     GL_R32F,
                                     GL_R32F,
                                     GenerateMip<R32F>,
                                     ReadColor<R32F, GLfloat>);
            return info;
        }
        case ID::R32_SINT:
        {
            static const Format info(ID::R32_SINT,
                                     GL_R32I,
                                     GL_R32I,
                                     GenerateMip<R32S>,
                                     ReadColor<R32S, GLint>);
            return info;
        }
        case ID::R32_UINT:
        {
            static const Format info(ID::R32_UINT,
                                     GL_R32UI,
                                     GL_R32UI,
                                     GenerateMip<R32>,
                                     ReadColor<R32, GLuint>);
            return info;
        }
        case ID::R5G6B5_UNORM:
        {
            static const Format info(ID::R5G6B5_UNORM,
                                     GL_RGB565,
                                     GL_RGB565,
                                     GenerateMip<R5G6B5>,
                                     ReadColor<R5G6B5, GLfloat>);
            return info;
        }
        case ID::R8G8B8A8_SINT:
        {
            static const Format info(ID::R8G8B8A8_SINT,
                                     GL_RGBA8I,
                                     GL_RGBA8I,
                                     GenerateMip<R8G8B8A8S>,
                                     ReadColor<R8G8B8A8S, GLint>);
            return info;
        }
        case ID::R8G8B8A8_SNORM:
        {
            static const Format info(ID::R8G8B8A8_SNORM,
                                     GL_RGBA8_SNORM,
                                     GL_RGBA8_SNORM,
                                     GenerateMip<R8G8B8A8S>,
                                     ReadColor<R8G8B8A8S, GLfloat>);
            return info;
        }
        case ID::R8G8B8A8_UINT:
        {
            static const Format info(ID::R8G8B8A8_UINT,
                                     GL_RGBA8UI,
                                     GL_RGBA8UI,
                                     GenerateMip<R8G8B8A8>,
                                     ReadColor<R8G8B8A8, GLuint>);
            return info;
        }
        case ID::R8G8B8A8_UNORM:
        {
            static const Format info(ID::R8G8B8A8_UNORM,
                                     GL_RGBA8,
                                     GL_RGBA8,
                                     GenerateMip<R8G8B8A8>,
                                     ReadColor<R8G8B8A8, GLfloat>);
            return info;
        }
        case ID::R8G8B8A8_UNORM_SRGB:
        {
            static const Format info(ID::R8G8B8A8_UNORM_SRGB,
                                     GL_SRGB8_ALPHA8,
                                     GL_SRGB8_ALPHA8,
                                     GenerateMip<R8G8B8A8>,
                                     ReadColor<R8G8B8A8, GLfloat>);
            return info;
        }
        case ID::R8G8_SINT:
        {
            static const Format info(ID::R8G8_SINT,
                                     GL_RG8I,
                                     GL_RG8I,
                                     GenerateMip<R8G8S>,
                                     ReadColor<R8G8S, GLint>);
            return info;
        }
        case ID::R8G8_SNORM:
        {
            static const Format info(ID::R8G8_SNORM,
                                     GL_RG8_SNORM,
                                     GL_RG8_SNORM,
                                     GenerateMip<R8G8S>,
                                     ReadColor<R8G8S, GLfloat>);
            return info;
        }
        case ID::R8G8_UINT:
        {
            static const Format info(ID::R8G8_UINT,
                                     GL_RG8UI,
                                     GL_RG8UI,
                                     GenerateMip<R8G8>,
                                     ReadColor<R8G8, GLuint>);
            return info;
        }
        case ID::R8G8_UNORM:
        {
            static const Format info(ID::R8G8_UNORM,
                                     GL_RG8,
                                     GL_RG8,
                                     GenerateMip<R8G8>,
                                     ReadColor<R8G8, GLfloat>);
            return info;
        }
        case ID::R8_SINT:
        {
            static const Format info(ID::R8_SINT,
                                     GL_R8I,
                                     GL_R8I,
                                     GenerateMip<R8S>,
                                     ReadColor<R8S, GLint>);
            return info;
        }
        case ID::R8_SNORM:
        {
            static const Format info(ID::R8_SNORM,
                                     GL_R8_SNORM,
                                     GL_R8_SNORM,
                                     GenerateMip<R8S>,
                                     ReadColor<R8S, GLfloat>);
            return info;
        }
        case ID::R8_UINT:
        {
            static const Format info(ID::R8_UINT,
                                     GL_R8UI,
                                     GL_R8UI,
                                     GenerateMip<R8>,
                                     ReadColor<R8, GLuint>);
            return info;
        }
        case ID::R8_UNORM:
        {
            static const Format info(ID::R8_UNORM,
                                     GL_R8,
                                     GL_R8,
                                     GenerateMip<R8>,
                                     ReadColor<R8, GLfloat>);
            return info;
        }
        case ID::R9G9B9E5_SHAREDEXP:
        {
            static const Format info(ID::R9G9B9E5_SHAREDEXP,
                                     GL_RGB9_E5,
                                     GL_RGB9_E5,
                                     GenerateMip<R9G9B9E5>,
                                     ReadColor<R9G9B9E5, GLfloat>);
            return info;
        }

        default:
            UNREACHABLE();
            break;
    }
    // clang-format on

    static const Format noneInfo(ID::NONE, GL_NONE, GL_NONE, nullptr, nullptr);
    return noneInfo;
}

}  // namespace angle
