#ifndef LIBANGLE_FORMATUTILS_H_
#define LIBANGLE_FORMATUTILS_H_
#include <stdint.h>
#include <cstddef>
#include <ostream>
#include "angle_gl.h"
#include "common/android_util.h"
#include "common/hash_containers.h"
#include "libANGLE/Caps.h"
#include "libANGLE/Config.h"
#include "libANGLE/Error.h"
#include "libANGLE/Version.h"
#include "libANGLE/VertexAttribute.h"
#include "libANGLE/angletypes.h"
namespace gl
{
struct VertexAttribute;
struct FormatType final
{ … };
struct Type
{ … };
uint32_t GetPackedTypeInfo(GLenum type);
ANGLE_INLINE GLenum GetNonLinearFormat(const GLenum format)
{ … }
ANGLE_INLINE bool ColorspaceFormatOverride(const EGLenum colorspace, GLenum *rendertargetformat)
{ … }
ANGLE_INLINE const Type GetTypeInfo(GLenum type)
{ … }
static_assert …;
static_assert …;
static_assert …;
ANGLE_INLINE GLuint GetDrawElementsTypeSize(DrawElementsType type)
{ … }
ANGLE_INLINE GLuint GetDrawElementsTypeShift(DrawElementsType type)
{ … }
struct InternalFormat
{ … };
struct Format
{ … };
const InternalFormat &GetSizedInternalFormatInfo(GLenum internalFormat);
const InternalFormat &GetInternalFormatInfo(GLenum internalFormat, GLenum type);
GLenum GetUnsizedFormat(GLenum internalFormat);
bool CompressedFormatRequiresWholeImage(GLenum internalFormat);
void MaybeOverrideLuminance(GLenum &format, GLenum &type, GLenum actualFormat, GLenum actualType);
FormatSet;
const FormatSet &GetAllSizedInternalFormats();
InternalFormatInfoMap;
const InternalFormatInfoMap &GetInternalFormatMap();
int GetAndroidHardwareBufferFormatFromChannelSizes(const egl::AttributeMap &attribMap);
GLenum GetConfigColorBufferFormat(const egl::Config *config);
GLenum GetConfigDepthStencilBufferFormat(const egl::Config *config);
ANGLE_INLINE int GetNativeVisualID(const InternalFormat &internalFormat)
{ … }
enum AttributeType
{ … };
AttributeType GetAttributeType(GLenum enumValue);
InputLayout;
struct VertexFormat : private angle::NonCopyable
{ … };
angle::FormatID GetVertexFormatID(VertexAttribType type,
GLboolean normalized,
GLuint components,
bool pureInteger);
angle::FormatID GetVertexFormatID(const VertexAttribute &attrib, VertexAttribType currentValueType);
angle::FormatID GetCurrentValueFormatID(VertexAttribType currentValueType);
const VertexFormat &GetVertexFormatFromID(angle::FormatID vertexFormatID);
size_t GetVertexFormatSize(angle::FormatID vertexFormatID);
angle::FormatID ConvertFormatSignedness(const angle::Format &format);
ANGLE_INLINE bool IsS3TCFormat(const GLenum format)
{ … }
ANGLE_INLINE bool IsRGTCFormat(const GLenum format)
{ … }
ANGLE_INLINE bool IsBPTCFormat(const GLenum format)
{ … }
ANGLE_INLINE bool IsASTC2DFormat(const GLenum format)
{ … }
ANGLE_INLINE bool IsETC1Format(const GLenum format)
{ … }
ANGLE_INLINE bool IsETC2EACFormat(const GLenum format)
{ … }
ANGLE_INLINE constexpr bool IsPVRTC1Format(const GLenum format)
{ … }
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
ANGLE_INLINE bool IsBGRAFormat(const GLenum internalFormat)
{ … }
bool ValidES3InternalFormat(GLenum internalFormat);
bool ValidES3Format(GLenum format);
bool ValidES3Type(GLenum type);
bool ValidES3FormatCombination(GLenum format, GLenum type, GLenum internalFormat);
bool ValidDesktopFormat(GLenum format);
bool ValidDesktopType(GLenum type);
bool ValidDesktopFormatCombination(GLenum format, GLenum type, GLenum internalFormat);
bool ValidES3CopyConversion(GLenum textureFormat, GLenum framebufferFormat);
ANGLE_INLINE ComponentType GetVertexAttributeComponentType(bool pureInteger, VertexAttribType type)
{ … }
constexpr std::size_t kMaxYuvPlaneCount = …;
YuvPlaneArray;
struct YuvFormatInfo
{ … };
bool IsYuvFormat(GLenum format);
uint32_t GetPlaneCount(GLenum format);
uint32_t GetYPlaneBpp(GLenum format);
uint32_t GetChromaPlaneBpp(GLenum format);
void GetSubSampleFactor(GLenum format,
int *horizontalSubsampleFactor,
int *verticalSubsampleFactor);
}
#endif