#ifndef LIBANGLE_ANGLETYPES_H_
#define LIBANGLE_ANGLETYPES_H_
#include <anglebase/sha1.h>
#include "common/Color.h"
#include "common/FixedVector.h"
#include "common/MemoryBuffer.h"
#include "common/PackedEnums.h"
#include "common/bitset_utils.h"
#include "common/hash_utils.h"
#include "common/vector_utils.h"
#include "libANGLE/Constants.h"
#include "libANGLE/Error.h"
#include "libANGLE/RefCountObject.h"
#include <inttypes.h>
#include <stdint.h>
#include <bitset>
#include <functional>
#include <map>
#include <memory>
#include <unordered_map>
namespace gl
{
class Buffer;
class Texture;
enum class Command
{ … };
enum CommandBlitBuffer
{ … };
enum class InitState
{ … };
template <typename T>
struct RectangleImpl
{ … };
template <typename T>
bool operator==(const RectangleImpl<T> &a, const RectangleImpl<T> &b);
template <typename T>
bool operator!=(const RectangleImpl<T> &a, const RectangleImpl<T> &b);
Rectangle;
[[nodiscard]] bool ClipRectangle(const Rectangle &source,
const Rectangle &clip,
Rectangle *intersection);
void GetEnclosingRectangle(const Rectangle &rect1, const Rectangle &rect2, Rectangle *rectUnion);
void ExtendRectangle(const Rectangle &source, const Rectangle &extend, Rectangle *extended);
struct Offset
{ … };
constexpr Offset kOffsetZero(0, 0, 0);
bool operator==(const Offset &a, const Offset &b);
bool operator!=(const Offset &a, const Offset &b);
struct Extents
{ … };
bool operator==(const Extents &lhs, const Extents &rhs);
bool operator!=(const Extents &lhs, const Extents &rhs);
struct Box
{ … };
struct RasterizerState final
{ … };
bool operator==(const RasterizerState &a, const RasterizerState &b);
bool operator!=(const RasterizerState &a, const RasterizerState &b);
struct BlendState final
{ … };
bool operator==(const BlendState &a, const BlendState &b);
bool operator!=(const BlendState &a, const BlendState &b);
struct DepthStencilState final
{ … };
bool operator==(const DepthStencilState &a, const DepthStencilState &b);
bool operator!=(const DepthStencilState &a, const DepthStencilState &b);
struct PackedSamplerCompleteness
{ … };
static_assert …;
class SamplerState final
{ … };
bool operator==(const SamplerState &a, const SamplerState &b);
bool operator!=(const SamplerState &a, const SamplerState &b);
struct DrawArraysIndirectCommand
{ … };
static_assert …;
struct DrawElementsIndirectCommand
{ … };
static_assert …;
struct ImageUnit
{ … };
ImageUnitTextureTypeMap;
struct PixelStoreStateBase
{ … };
struct PixelUnpackState : PixelStoreStateBase
{ … };
struct PixelPackState : PixelStoreStateBase
{ … };
VertexArrayBufferBindingMask;
AttributesMask;
ProgramUniformBlockMask;
ProgramUniformBlockArray;
UniformBufferBindingArray;
DrawBufferMask;
class BlendStateExt final
{ … };
static_assert …;
StorageBuffersMask;
SampleMaskArray;
TexLevelArray;
TexLevelMask;
enum class ComponentType
{ … };
constexpr ComponentType GLenumToComponentType(GLenum componentType)
{ … }
constexpr angle::PackedEnumMap<ComponentType, uint32_t> kComponentMasks = …;
constexpr size_t kMaxComponentTypeMaskIndex = …;
ComponentTypeMask;
ANGLE_INLINE void SetComponentTypeMask(ComponentType type, size_t index, ComponentTypeMask *mask)
{ … }
ANGLE_INLINE ComponentType GetComponentTypeMask(ComponentTypeMask mask, size_t index)
{ … }
ANGLE_INLINE ComponentTypeMask GetActiveComponentTypeMask(gl::AttributesMask activeAttribLocations)
{ … }
ANGLE_INLINE DrawBufferMask GetComponentTypeMaskDiff(ComponentTypeMask mask1,
ComponentTypeMask mask2)
{ … }
bool ValidateComponentTypeMasks(unsigned long outputTypes,
unsigned long inputTypes,
unsigned long outputMask,
unsigned long inputMask);
static_assert …;
static_assert …;
static_assert …;
ANGLE_INLINE bool IsComponentTypeFloatOrInt(ComponentTypeMask mask, size_t index)
{ … }
ANGLE_INLINE bool IsComponentTypeFloatOrUnsignedInt(ComponentTypeMask mask, size_t index)
{ … }
ANGLE_INLINE bool IsComponentTypeIntOrUnsignedInt(ComponentTypeMask mask, size_t index)
{ … }
ANGLE_INLINE DrawBufferMask GetIntOrUnsignedIntDrawBufferMask(ComponentTypeMask mask)
{ … }
enum class RenderToTextureImageIndex
{ … };
RenderToTextureImageMap;
constexpr size_t kCubeFaceCount = …;
CubeFaceArray;
TextureTypeMap;
TextureMap;
ShaderVector;
AttachmentArray;
AttachmentVector;
AttachmentsMask;
DrawBuffersArray;
DrawBuffersVector;
AttribArray;
AttribVector;
ActiveTextureMask;
ActiveTextureArray;
ActiveTextureTypeArray;
ImageUnitMask;
SupportedSampleSet;
TransformFeedbackBuffersArray;
ClipDistanceEnableBits;
QueryTypeMap;
constexpr size_t kBarrierVectorDefaultSize = …;
BarrierVector;
BufferBarrierVector;
SamplerBindingVector;
BufferVector;
struct TextureAndLayout
{ … };
TextureBarrierVector;
GLsizeiptr GetBoundBufferAvailableSize(const OffsetBindingPointer<Buffer> &binding);
template <typename T>
class LevelIndexWrapper
{ … };
LevelIndex;
enum class MultisamplingMode
{ … };
}
namespace rx
{
#if defined(__clang__)
# if __has_feature(cxx_rtti)
#define ANGLE_HAS_DYNAMIC_CAST …
# endif
#elif !defined(NDEBUG) && (!defined(_MSC_VER) || defined(_CPPRTTI)) && \
(!defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || \
defined(__GXX_RTTI))
#define ANGLE_HAS_DYNAMIC_CAST …
#endif
#ifdef ANGLE_HAS_DYNAMIC_CAST
#define ANGLE_HAS_DYNAMIC_TYPE …
# undef ANGLE_HAS_DYNAMIC_CAST
#else
#define ANGLE_HAS_DYNAMIC_TYPE …
#endif
template <typename DestT, typename SrcT>
inline DestT *GetAs(SrcT *src)
{ … }
template <typename DestT, typename SrcT>
inline const DestT *GetAs(const SrcT *src)
{ … }
#undef ANGLE_HAS_DYNAMIC_TYPE
template <typename DestT, typename SrcT>
inline DestT *GetImplAs(SrcT *src)
{ … }
template <typename DestT, typename SrcT>
inline DestT *SafeGetImplAs(SrcT *src)
{ … }
}
#include "angletypes.inc"
namespace angle
{
enum class NativeWindowSystem
{ … };
struct FeatureOverrides
{ … };
static constexpr size_t kBlobCacheKeyLength = …;
BlobCacheKey;
class BlobCacheValue
{ … };
bool CompressBlob(const size_t cacheSize, const uint8_t *cacheData, MemoryBuffer *compressedData);
bool DecompressBlob(const uint8_t *compressedData,
const size_t compressedSize,
size_t maxUncompressedDataSize,
MemoryBuffer *uncompressedData);
uint32_t GenerateCRC32(const uint8_t *data, size_t size);
}
namespace std
{
template <>
struct hash<angle::BlobCacheKey>
{ … };
}
namespace angle
{
class UnlockedTailCall final : angle::NonCopyable
{ … };
enum class JobThreadSafety
{ … };
enum class JobResultExpectancy
{ … };
enum FramebufferBinding
{ … };
inline FramebufferBinding EnumToFramebufferBinding(GLenum enumValue)
{ … }
inline GLenum FramebufferBindingToEnum(FramebufferBinding binding)
{ … }
template <typename ObjT, typename ContextT>
class DestroyThenDelete
{ … };
UniqueObjectPointer;
}
namespace gl
{
class State;
struct FocalPoint
{ … };
constexpr FocalPoint kDefaultFocalPoint = …;
class FoveationState
{ … };
}
#endif