Commit 95fb2a17 by Frank Henigman Committed by Commit Bot

Add vertex formats and lookup function.

Add an angle::Format for each ES2 vertex data format. Add function GetVertexFormatID() to get the angle::Format for a vertex attribute. These will be used later to support vertex formats in Vulkan (by mapping angle::Format to Vulkan format) and to eliminate the redundant enum gl::VertexFormatType. No functional change. BUG=angleproject:2405 BUG=angleproject:2531 Change-Id: I871ae23ce9fba57d90c554376e84b03f8514f7fc Reviewed-on: https://chromium-review.googlesource.com/1044874Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
parent 4fef7738
......@@ -14,9 +14,9 @@
#include <climits>
#include <cstdarg>
#include <cstddef>
#include <string>
#include <set>
#include <sstream>
#include <string>
#include <vector>
// A helper class to disallow copy and assignment operators
......@@ -31,11 +31,11 @@ class NonCopyable
{
protected:
constexpr NonCopyable() = default;
~NonCopyable() = default;
~NonCopyable() = default;
private:
NonCopyable(const NonCopyable&) = delete;
void operator=(const NonCopyable&) = delete;
NonCopyable(const NonCopyable &) = delete;
void operator=(const NonCopyable &) = delete;
};
extern const uintptr_t DirtyPointer;
......@@ -86,7 +86,7 @@ void SafeRelease(T (&resourceBlock)[N])
}
template <typename T>
void SafeRelease(T& resource)
void SafeRelease(T &resource)
{
if (resource)
{
......@@ -103,7 +103,7 @@ void SafeDelete(T *&resource)
}
template <typename T>
void SafeDeleteContainer(T& resource)
void SafeDeleteContainer(T &resource)
{
for (auto &element : resource)
{
......@@ -113,7 +113,7 @@ void SafeDeleteContainer(T& resource)
}
template <typename T>
void SafeDeleteArray(T*& resource)
void SafeDeleteArray(T *&resource)
{
delete[] resource;
resource = nullptr;
......@@ -148,7 +148,7 @@ inline bool IsMaskFlagSet(T mask, T flag)
return (mask & flag) == flag;
}
inline const char* MakeStaticString(const std::string &str)
inline const char *MakeStaticString(const std::string &str)
{
static std::set<std::string> strings;
std::set<std::string>::iterator it = strings.find(str);
......@@ -173,7 +173,7 @@ inline std::string Str(int i)
return strstr.str();
}
size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector<char>& buffer);
size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector<char> &buffer);
std::string FormatString(const char *fmt, va_list vararg);
std::string FormatString(const char *fmt, ...);
......@@ -207,6 +207,52 @@ std::string ToString(const T &value)
#define GL_BGRA8_TYPELESS_ANGLEX 0x6AC3
#define GL_BGRA8_TYPELESS_SRGB_ANGLEX 0x6AC4
#define GL_R8_SSCALED_ANGLEX 0x6AC6
#define GL_RG8_SSCALED_ANGLEX 0x6AC7
#define GL_RGB8_SSCALED_ANGLEX 0x6AC8
#define GL_RGBA8_SSCALED_ANGLEX 0x6AC9
#define GL_R8_USCALED_ANGLEX 0x6ACA
#define GL_RG8_USCALED_ANGLEX 0x6ACB
#define GL_RGB8_USCALED_ANGLEX 0x6ACC
#define GL_RGBA8_USCALED_ANGLEX 0x6ACD
#define GL_R16_SSCALED_ANGLEX 0x6ACE
#define GL_RG16_SSCALED_ANGLEX 0x6ACF
#define GL_RGB16_SSCALED_ANGLEX 0x6AD0
#define GL_RGBA16_SSCALED_ANGLEX 0x6AD1
#define GL_R16_USCALED_ANGLEX 0x6AD2
#define GL_RG16_USCALED_ANGLEX 0x6AD3
#define GL_RGB16_USCALED_ANGLEX 0x6AD4
#define GL_RGBA16_USCALED_ANGLEX 0x6AD5
#define GL_R32_SSCALED_ANGLEX 0x6AD6
#define GL_RG32_SSCALED_ANGLEX 0x6AD7
#define GL_RGB32_SSCALED_ANGLEX 0x6AD8
#define GL_RGBA32_SSCALED_ANGLEX 0x6AD9
#define GL_R32_USCALED_ANGLEX 0x6ADA
#define GL_RG32_USCALED_ANGLEX 0x6ADB
#define GL_RGB32_USCALED_ANGLEX 0x6ADC
#define GL_RGBA32_USCALED_ANGLEX 0x6ADD
#define GL_R32_SNORM_ANGLEX 0x6ADE
#define GL_RG32_SNORM_ANGLEX 0x6ADF
#define GL_RGB32_SNORM_ANGLEX 0x6AE0
#define GL_RGBA32_SNORM_ANGLEX 0x6AE1
#define GL_R32_UNORM_ANGLEX 0x6AE2
#define GL_RG32_UNORM_ANGLEX 0x6AE3
#define GL_RGB32_UNORM_ANGLEX 0x6AE4
#define GL_RGBA32_UNORM_ANGLEX 0x6AE5
#define GL_R32_FIXED_ANGLEX 0x6AE6
#define GL_RG32_FIXED_ANGLEX 0x6AE7
#define GL_RGB32_FIXED_ANGLEX 0x6AE8
#define GL_RGBA32_FIXED_ANGLEX 0x6AE9
#define GL_RGB10_A2_SINT_ANGLEX 0x6AEA
#define GL_RGB10_A2_SNORM_ANGLEX 0x6AEB
#define GL_RGB10_A2_SSCALED_ANGLEX 0x6AEC
#define GL_RGB10_A2_USCALED_ANGLEX 0x6AED
// TODO(jmadill): Clean this up at some point.
#define EGL_PLATFORM_ANGLE_PLATFORM_METHODS_ANGLEX 0x9999
......@@ -267,4 +313,4 @@ std::string ToString(const T &value)
#define ANGLE_NO_DISCARD
#endif // __has_cpp_attribute(nodiscard)
#endif // COMMON_ANGLEUTILS_H_
#endif // COMMON_ANGLEUTILS_H_
......@@ -1673,6 +1673,46 @@ void R10G10B10A2::average(R10G10B10A2 *dst, const R10G10B10A2 *src1, const R10G1
dst->A = gl::average(src1->A, src2->A);
}
void R10G10B10A2S::readColor(gl::ColorI *dst, const R10G10B10A2S *src)
{
dst->red = src->R;
dst->green = src->G;
dst->blue = src->B;
dst->alpha = src->A;
}
void R10G10B10A2S::readColor(gl::ColorF *dst, const R10G10B10A2S *src)
{
dst->red = gl::normalizedToFloat<10>(src->R);
dst->green = gl::normalizedToFloat<10>(src->G);
dst->blue = gl::normalizedToFloat<10>(src->B);
dst->alpha = gl::normalizedToFloat<2>(src->A);
}
void R10G10B10A2S::writeColor(R10G10B10A2S *dst, const gl::ColorI *src)
{
dst->R = static_cast<int32_t>(src->red);
dst->G = static_cast<int32_t>(src->green);
dst->B = static_cast<int32_t>(src->blue);
dst->A = static_cast<int32_t>(src->alpha);
}
void R10G10B10A2S::writeColor(R10G10B10A2S *dst, const gl::ColorF *src)
{
dst->R = gl::floatToNormalized<10, int32_t>(src->red);
dst->G = gl::floatToNormalized<10, int32_t>(src->green);
dst->B = gl::floatToNormalized<10, int32_t>(src->blue);
dst->A = gl::floatToNormalized<2, int32_t>(src->alpha);
}
void R10G10B10A2S::average(R10G10B10A2S *dst, const R10G10B10A2S *src1, const R10G10B10A2S *src2)
{
dst->R = gl::average(src1->R, src2->R);
dst->G = gl::average(src1->G, src2->G);
dst->B = gl::average(src1->B, src2->B);
dst->A = gl::average(src1->A, src2->A);
}
void R9G9B9E5::readColor(gl::ColorF *dst, const R9G9B9E5 *src)
{
gl::convert999E5toRGBFloats(gl::bitCast<uint32_t>(*src), &dst->red, &dst->green, &dst->blue);
......
......@@ -670,6 +670,21 @@ struct R10G10B10A2
};
static_assert(sizeof(R10G10B10A2) == 4, "R10G10B10A2 struct not 32-bits.");
struct R10G10B10A2S
{
int32_t R : 10;
int32_t G : 10;
int32_t B : 10;
int32_t A : 2;
static void readColor(gl::ColorF *dst, const R10G10B10A2S *src);
static void readColor(gl::ColorI *dst, const R10G10B10A2S *src);
static void writeColor(R10G10B10A2S *dst, const gl::ColorF *src);
static void writeColor(R10G10B10A2S *dst, const gl::ColorI *src);
static void average(R10G10B10A2S *dst, const R10G10B10A2S *src1, const R10G10B10A2S *src2);
};
static_assert(sizeof(R10G10B10A2S) == 4, "R10G10B10A2S struct not 32-bits.");
struct R9G9B9E5
{
uint32_t R : 9;
......
......@@ -17,9 +17,9 @@ using namespace angle;
namespace gl
{
// ES2 requires that format is equal to internal format at all glTex*Image2D entry points and the implementation
// can decide the true, sized, internal format. The ES2FormatMap determines the internal format for all valid
// format and type combinations.
// ES2 requires that format is equal to internal format at all glTex*Image2D entry points and the
// implementation can decide the true, sized, internal format. The ES2FormatMap determines the
// internal format for all valid format and type combinations.
GLenum GetSizedFormatInternal(GLenum format, GLenum type);
namespace
......@@ -44,10 +44,7 @@ bool FormatType::operator<(const FormatType &other) const
return type < other.type;
}
Type::Type()
: bytes(0),
bytesShift(0),
specialInterpretation(false)
Type::Type() : bytes(0), bytesShift(0), specialInterpretation(false)
{
}
......@@ -55,7 +52,7 @@ static Type GenTypeInfo(GLuint bytes, bool specialInterpretation)
{
Type info;
info.bytes = bytes;
GLuint i = 0;
GLuint i = 0;
while ((1u << i) < bytes)
{
++i;
......@@ -66,7 +63,7 @@ static Type GenTypeInfo(GLuint bytes, bool specialInterpretation)
return info;
}
bool operator<(const Type& a, const Type& b)
bool operator<(const Type &a, const Type &b)
{
return memcmp(&a, &b, sizeof(Type)) < 0;
}
......@@ -541,21 +538,21 @@ void AddRGBAFormat(InternalFormatInfoMap *map,
formatInfo.sized = sized;
formatInfo.sizedInternalFormat =
sized ? internalFormat : GetSizedFormatInternal(internalFormat, type);
formatInfo.redBits = red;
formatInfo.greenBits = green;
formatInfo.blueBits = blue;
formatInfo.alphaBits = alpha;
formatInfo.redBits = red;
formatInfo.greenBits = green;
formatInfo.blueBits = blue;
formatInfo.alphaBits = alpha;
formatInfo.sharedBits = shared;
formatInfo.pixelBytes = (red + green + blue + alpha + shared) / 8;
formatInfo.componentCount =
((red > 0) ? 1 : 0) + ((green > 0) ? 1 : 0) + ((blue > 0) ? 1 : 0) + ((alpha > 0) ? 1 : 0);
formatInfo.format = format;
formatInfo.type = type;
formatInfo.componentType = componentType;
formatInfo.colorEncoding = (srgb ? GL_SRGB : GL_LINEAR);
formatInfo.format = format;
formatInfo.type = type;
formatInfo.componentType = componentType;
formatInfo.colorEncoding = (srgb ? GL_SRGB : GL_LINEAR);
formatInfo.textureSupport = textureSupport;
formatInfo.renderSupport = renderSupport;
formatInfo.filterSupport = filterSupport;
formatInfo.renderSupport = renderSupport;
formatInfo.filterSupport = filterSupport;
InsertFormatInfo(map, formatInfo);
}
......@@ -577,17 +574,17 @@ static void AddLUMAFormat(InternalFormatInfoMap *map,
formatInfo.sized = sized;
formatInfo.sizedInternalFormat =
sized ? internalFormat : GetSizedFormatInternal(internalFormat, type);
formatInfo.luminanceBits = luminance;
formatInfo.alphaBits = alpha;
formatInfo.pixelBytes = (luminance + alpha) / 8;
formatInfo.luminanceBits = luminance;
formatInfo.alphaBits = alpha;
formatInfo.pixelBytes = (luminance + alpha) / 8;
formatInfo.componentCount = ((luminance > 0) ? 1 : 0) + ((alpha > 0) ? 1 : 0);
formatInfo.format = format;
formatInfo.type = type;
formatInfo.componentType = componentType;
formatInfo.colorEncoding = GL_LINEAR;
formatInfo.format = format;
formatInfo.type = type;
formatInfo.componentType = componentType;
formatInfo.colorEncoding = GL_LINEAR;
formatInfo.textureSupport = textureSupport;
formatInfo.renderSupport = renderSupport;
formatInfo.filterSupport = filterSupport;
formatInfo.renderSupport = renderSupport;
formatInfo.filterSupport = filterSupport;
InsertFormatInfo(map, formatInfo);
}
......@@ -610,17 +607,17 @@ void AddDepthStencilFormat(InternalFormatInfoMap *map,
formatInfo.sized = sized;
formatInfo.sizedInternalFormat =
sized ? internalFormat : GetSizedFormatInternal(internalFormat, type);
formatInfo.depthBits = depthBits;
formatInfo.stencilBits = stencilBits;
formatInfo.pixelBytes = (depthBits + stencilBits + unusedBits) / 8;
formatInfo.depthBits = depthBits;
formatInfo.stencilBits = stencilBits;
formatInfo.pixelBytes = (depthBits + stencilBits + unusedBits) / 8;
formatInfo.componentCount = ((depthBits > 0) ? 1 : 0) + ((stencilBits > 0) ? 1 : 0);
formatInfo.format = format;
formatInfo.type = type;
formatInfo.componentType = componentType;
formatInfo.colorEncoding = GL_LINEAR;
formatInfo.format = format;
formatInfo.type = type;
formatInfo.componentType = componentType;
formatInfo.colorEncoding = GL_LINEAR;
formatInfo.textureSupport = textureSupport;
formatInfo.renderSupport = renderSupport;
formatInfo.filterSupport = filterSupport;
formatInfo.renderSupport = renderSupport;
formatInfo.filterSupport = filterSupport;
InsertFormatInfo(map, formatInfo);
}
......@@ -642,18 +639,18 @@ void AddCompressedFormat(InternalFormatInfoMap *map,
formatInfo.internalFormat = internalFormat;
formatInfo.sized = true;
formatInfo.sizedInternalFormat = internalFormat;
formatInfo.compressedBlockWidth = compressedBlockWidth;
formatInfo.compressedBlockWidth = compressedBlockWidth;
formatInfo.compressedBlockHeight = compressedBlockHeight;
formatInfo.pixelBytes = compressedBlockSize / 8;
formatInfo.componentCount = componentCount;
formatInfo.format = format;
formatInfo.type = type;
formatInfo.componentType = GL_UNSIGNED_NORMALIZED;
formatInfo.colorEncoding = (srgb ? GL_SRGB : GL_LINEAR);
formatInfo.compressed = true;
formatInfo.textureSupport = textureSupport;
formatInfo.renderSupport = renderSupport;
formatInfo.filterSupport = filterSupport;
formatInfo.pixelBytes = compressedBlockSize / 8;
formatInfo.componentCount = componentCount;
formatInfo.format = format;
formatInfo.type = type;
formatInfo.componentType = GL_UNSIGNED_NORMALIZED;
formatInfo.colorEncoding = (srgb ? GL_SRGB : GL_LINEAR);
formatInfo.compressed = true;
formatInfo.textureSupport = textureSupport;
formatInfo.renderSupport = renderSupport;
formatInfo.filterSupport = filterSupport;
InsertFormatInfo(map, formatInfo);
}
......@@ -970,51 +967,51 @@ const Type &GetTypeInfo(GLenum type)
{
switch (type)
{
case GL_UNSIGNED_BYTE:
case GL_BYTE:
case GL_UNSIGNED_BYTE:
case GL_BYTE:
{
static const Type info = GenTypeInfo(1, false);
return info;
}
case GL_UNSIGNED_SHORT:
case GL_SHORT:
case GL_HALF_FLOAT:
case GL_HALF_FLOAT_OES:
case GL_UNSIGNED_SHORT:
case GL_SHORT:
case GL_HALF_FLOAT:
case GL_HALF_FLOAT_OES:
{
static const Type info = GenTypeInfo(2, false);
return info;
}
case GL_UNSIGNED_INT:
case GL_INT:
case GL_FLOAT:
case GL_UNSIGNED_INT:
case GL_INT:
case GL_FLOAT:
{
static const Type info = GenTypeInfo(4, false);
return info;
}
case GL_UNSIGNED_SHORT_5_6_5:
case GL_UNSIGNED_SHORT_4_4_4_4:
case GL_UNSIGNED_SHORT_5_5_5_1:
case GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT:
case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT:
case GL_UNSIGNED_SHORT_5_6_5:
case GL_UNSIGNED_SHORT_4_4_4_4:
case GL_UNSIGNED_SHORT_5_5_5_1:
case GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT:
case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT:
{
static const Type info = GenTypeInfo(2, true);
return info;
}
case GL_UNSIGNED_INT_2_10_10_10_REV:
case GL_UNSIGNED_INT_24_8:
case GL_UNSIGNED_INT_10F_11F_11F_REV:
case GL_UNSIGNED_INT_5_9_9_9_REV:
case GL_UNSIGNED_INT_2_10_10_10_REV:
case GL_UNSIGNED_INT_24_8:
case GL_UNSIGNED_INT_10F_11F_11F_REV:
case GL_UNSIGNED_INT_5_9_9_9_REV:
{
ASSERT(GL_UNSIGNED_INT_24_8_OES == GL_UNSIGNED_INT_24_8);
static const Type info = GenTypeInfo(4, true);
return info;
}
case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
{
static const Type info = GenTypeInfo(8, true);
return info;
}
default:
default:
{
static const Type defaultInfo;
return defaultInfo;
......@@ -1077,9 +1074,9 @@ GLuint InternalFormat::computePixelBytes(GLenum formatType) const
}
ErrorOrResult<GLuint> InternalFormat::computeRowPitch(GLenum formatType,
GLsizei width,
GLint alignment,
GLint rowLength) const
GLsizei width,
GLint alignment,
GLint rowLength) const
{
// Compressed images do not use pack/unpack parameters.
if (compressed)
......@@ -1112,11 +1109,11 @@ ErrorOrResult<GLuint> InternalFormat::computeDepthPitch(GLsizei height,
}
ErrorOrResult<GLuint> InternalFormat::computeDepthPitch(GLenum formatType,
GLsizei width,
GLsizei height,
GLint alignment,
GLint rowLength,
GLint imageHeight) const
GLsizei width,
GLsizei height,
GLint alignment,
GLint rowLength,
GLint imageHeight) const
{
GLuint rowPitch = 0;
ANGLE_TRY_RESULT(computeRowPitch(formatType, width, alignment, rowLength), rowPitch);
......@@ -1162,11 +1159,10 @@ ErrorOrResult<GLuint> InternalFormat::computeSkipBytes(GLenum formatType,
return skipBytes.ValueOrDie();
}
ErrorOrResult<GLuint> InternalFormat::computePackUnpackEndByte(
GLenum formatType,
const Extents &size,
const PixelStoreStateBase &state,
bool is3D) const
ErrorOrResult<GLuint> InternalFormat::computePackUnpackEndByte(GLenum formatType,
const Extents &size,
const PixelStoreStateBase &state,
bool is3D) const
{
GLuint rowPitch = 0;
ANGLE_TRY_RESULT(computeRowPitch(formatType, size.width, state.alignment, state.rowLength),
......@@ -1279,7 +1275,10 @@ AttributeType GetAttributeType(GLenum enumValue)
}
}
VertexFormatType GetVertexFormatType(GLenum type, GLboolean normalized, GLuint components, bool pureInteger)
angle::Format::ID GetVertexFormatID(GLenum type,
GLboolean normalized,
GLuint components,
bool pureInteger)
{
switch (type)
{
......@@ -1288,32 +1287,32 @@ VertexFormatType GetVertexFormatType(GLenum type, GLboolean normalized, GLuint c
{
case 1:
if (pureInteger)
return VERTEX_FORMAT_SBYTE1_INT;
return angle::Format::ID::R8_SINT;
if (normalized)
return VERTEX_FORMAT_SBYTE1_NORM;
return VERTEX_FORMAT_SBYTE1;
return angle::Format::ID::R8_SNORM;
return angle::Format::ID::R8_SSCALED;
case 2:
if (pureInteger)
return VERTEX_FORMAT_SBYTE2_INT;
return angle::Format::ID::R8G8_SINT;
if (normalized)
return VERTEX_FORMAT_SBYTE2_NORM;
return VERTEX_FORMAT_SBYTE2;
return angle::Format::ID::R8G8_SNORM;
return angle::Format::ID::R8G8_SSCALED;
case 3:
if (pureInteger)
return VERTEX_FORMAT_SBYTE3_INT;
return angle::Format::ID::R8G8B8_SINT;
if (normalized)
return VERTEX_FORMAT_SBYTE3_NORM;
return VERTEX_FORMAT_SBYTE3;
return angle::Format::ID::R8G8B8_SNORM;
return angle::Format::ID::R8G8B8_SSCALED;
case 4:
if (pureInteger)
return VERTEX_FORMAT_SBYTE4_INT;
return angle::Format::ID::R8G8B8A8_SINT;
if (normalized)
return VERTEX_FORMAT_SBYTE4_NORM;
return VERTEX_FORMAT_SBYTE4;
return angle::Format::ID::R8G8B8A8_SNORM;
return angle::Format::ID::R8G8B8A8_SSCALED;
default:
UNREACHABLE();
#if !UNREACHABLE_IS_NORETURN
return VERTEX_FORMAT_INVALID;
return angle::Format::ID::NONE;
#endif
}
case GL_UNSIGNED_BYTE:
......@@ -1321,32 +1320,32 @@ VertexFormatType GetVertexFormatType(GLenum type, GLboolean normalized, GLuint c
{
case 1:
if (pureInteger)
return VERTEX_FORMAT_UBYTE1_INT;
return angle::Format::ID::R8_UINT;
if (normalized)
return VERTEX_FORMAT_UBYTE1_NORM;
return VERTEX_FORMAT_UBYTE1;
return angle::Format::ID::R8_UNORM;
return angle::Format::ID::R8_USCALED;
case 2:
if (pureInteger)
return VERTEX_FORMAT_UBYTE2_INT;
return angle::Format::ID::R8G8_UINT;
if (normalized)
return VERTEX_FORMAT_UBYTE2_NORM;
return VERTEX_FORMAT_UBYTE2;
return angle::Format::ID::R8G8_UNORM;
return angle::Format::ID::R8G8_USCALED;
case 3:
if (pureInteger)
return VERTEX_FORMAT_UBYTE3_INT;
return angle::Format::ID::R8G8B8_UINT;
if (normalized)
return VERTEX_FORMAT_UBYTE3_NORM;
return VERTEX_FORMAT_UBYTE3;
return angle::Format::ID::R8G8B8_UNORM;
return angle::Format::ID::R8G8B8_USCALED;
case 4:
if (pureInteger)
return VERTEX_FORMAT_UBYTE4_INT;
return angle::Format::ID::R8G8B8A8_UINT;
if (normalized)
return VERTEX_FORMAT_UBYTE4_NORM;
return VERTEX_FORMAT_UBYTE4;
return angle::Format::ID::R8G8B8A8_UNORM;
return angle::Format::ID::R8G8B8A8_USCALED;
default:
UNREACHABLE();
#if !UNREACHABLE_IS_NORETURN
return VERTEX_FORMAT_INVALID;
return angle::Format::ID::NONE;
#endif
}
case GL_SHORT:
......@@ -1354,32 +1353,32 @@ VertexFormatType GetVertexFormatType(GLenum type, GLboolean normalized, GLuint c
{
case 1:
if (pureInteger)
return VERTEX_FORMAT_SSHORT1_INT;
return angle::Format::ID::R16_SINT;
if (normalized)
return VERTEX_FORMAT_SSHORT1_NORM;
return VERTEX_FORMAT_SSHORT1;
return angle::Format::ID::R16_SNORM;
return angle::Format::ID::R16_SSCALED;
case 2:
if (pureInteger)
return VERTEX_FORMAT_SSHORT2_INT;
return angle::Format::ID::R16G16_SINT;
if (normalized)
return VERTEX_FORMAT_SSHORT2_NORM;
return VERTEX_FORMAT_SSHORT2;
return angle::Format::ID::R16G16_SNORM;
return angle::Format::ID::R16G16_SSCALED;
case 3:
if (pureInteger)
return VERTEX_FORMAT_SSHORT3_INT;
return angle::Format::ID::R16G16B16_SINT;
if (normalized)
return VERTEX_FORMAT_SSHORT3_NORM;
return VERTEX_FORMAT_SSHORT3;
return angle::Format::ID::R16G16B16_SNORM;
return angle::Format::ID::R16G16B16_SSCALED;
case 4:
if (pureInteger)
return VERTEX_FORMAT_SSHORT4_INT;
return angle::Format::ID::R16G16B16A16_SINT;
if (normalized)
return VERTEX_FORMAT_SSHORT4_NORM;
return VERTEX_FORMAT_SSHORT4;
return angle::Format::ID::R16G16B16A16_SNORM;
return angle::Format::ID::R16G16B16A16_SSCALED;
default:
UNREACHABLE();
#if !UNREACHABLE_IS_NORETURN
return VERTEX_FORMAT_INVALID;
return angle::Format::ID::NONE;
#endif
}
case GL_UNSIGNED_SHORT:
......@@ -1387,32 +1386,32 @@ VertexFormatType GetVertexFormatType(GLenum type, GLboolean normalized, GLuint c
{
case 1:
if (pureInteger)
return VERTEX_FORMAT_USHORT1_INT;
return angle::Format::ID::R16_UINT;
if (normalized)
return VERTEX_FORMAT_USHORT1_NORM;
return VERTEX_FORMAT_USHORT1;
return angle::Format::ID::R16_UNORM;
return angle::Format::ID::R16_USCALED;
case 2:
if (pureInteger)
return VERTEX_FORMAT_USHORT2_INT;
return angle::Format::ID::R16G16_UINT;
if (normalized)
return VERTEX_FORMAT_USHORT2_NORM;
return VERTEX_FORMAT_USHORT2;
return angle::Format::ID::R16G16_UNORM;
return angle::Format::ID::R16G16_USCALED;
case 3:
if (pureInteger)
return VERTEX_FORMAT_USHORT3_INT;
return angle::Format::ID::R16G16B16_UINT;
if (normalized)
return VERTEX_FORMAT_USHORT3_NORM;
return VERTEX_FORMAT_USHORT3;
return angle::Format::ID::R16G16B16_UNORM;
return angle::Format::ID::R16G16B16_USCALED;
case 4:
if (pureInteger)
return VERTEX_FORMAT_USHORT4_INT;
return angle::Format::ID::R16G16B16A16_UINT;
if (normalized)
return VERTEX_FORMAT_USHORT4_NORM;
return VERTEX_FORMAT_USHORT4;
return angle::Format::ID::R16G16B16A16_UNORM;
return angle::Format::ID::R16G16B16A16_USCALED;
default:
UNREACHABLE();
#if !UNREACHABLE_IS_NORETURN
return VERTEX_FORMAT_INVALID;
return angle::Format::ID::NONE;
#endif
}
case GL_INT:
......@@ -1420,32 +1419,32 @@ VertexFormatType GetVertexFormatType(GLenum type, GLboolean normalized, GLuint c
{
case 1:
if (pureInteger)
return VERTEX_FORMAT_SINT1_INT;
return angle::Format::ID::R32_SINT;
if (normalized)
return VERTEX_FORMAT_SINT1_NORM;
return VERTEX_FORMAT_SINT1;
return angle::Format::ID::R32_SNORM;
return angle::Format::ID::R32_SSCALED;
case 2:
if (pureInteger)
return VERTEX_FORMAT_SINT2_INT;
return angle::Format::ID::R32G32_SINT;
if (normalized)
return VERTEX_FORMAT_SINT2_NORM;
return VERTEX_FORMAT_SINT2;
return angle::Format::ID::R32G32_SNORM;
return angle::Format::ID::R32G32_SSCALED;
case 3:
if (pureInteger)
return VERTEX_FORMAT_SINT3_INT;
return angle::Format::ID::R32G32B32_SINT;
if (normalized)
return VERTEX_FORMAT_SINT3_NORM;
return VERTEX_FORMAT_SINT3;
return angle::Format::ID::R32G32B32_SNORM;
return angle::Format::ID::R32G32B32_SSCALED;
case 4:
if (pureInteger)
return VERTEX_FORMAT_SINT4_INT;
return angle::Format::ID::R32G32B32A32_SINT;
if (normalized)
return VERTEX_FORMAT_SINT4_NORM;
return VERTEX_FORMAT_SINT4;
return angle::Format::ID::R32G32B32A32_SNORM;
return angle::Format::ID::R32G32B32A32_SSCALED;
default:
UNREACHABLE();
#if !UNREACHABLE_IS_NORETURN
return VERTEX_FORMAT_INVALID;
return angle::Format::ID::NONE;
#endif
}
case GL_UNSIGNED_INT:
......@@ -1453,105 +1452,303 @@ VertexFormatType GetVertexFormatType(GLenum type, GLboolean normalized, GLuint c
{
case 1:
if (pureInteger)
return VERTEX_FORMAT_UINT1_INT;
return angle::Format::ID::R32_UINT;
if (normalized)
return VERTEX_FORMAT_UINT1_NORM;
return VERTEX_FORMAT_UINT1;
return angle::Format::ID::R32_UNORM;
return angle::Format::ID::R32_USCALED;
case 2:
if (pureInteger)
return VERTEX_FORMAT_UINT2_INT;
return angle::Format::ID::R32G32_UINT;
if (normalized)
return VERTEX_FORMAT_UINT2_NORM;
return VERTEX_FORMAT_UINT2;
return angle::Format::ID::R32G32_UNORM;
return angle::Format::ID::R32G32_USCALED;
case 3:
if (pureInteger)
return VERTEX_FORMAT_UINT3_INT;
return angle::Format::ID::R32G32B32_UINT;
if (normalized)
return VERTEX_FORMAT_UINT3_NORM;
return VERTEX_FORMAT_UINT3;
return angle::Format::ID::R32G32B32_UNORM;
return angle::Format::ID::R32G32B32_USCALED;
case 4:
if (pureInteger)
return VERTEX_FORMAT_UINT4_INT;
return angle::Format::ID::R32G32B32A32_UINT;
if (normalized)
return VERTEX_FORMAT_UINT4_NORM;
return VERTEX_FORMAT_UINT4;
return angle::Format::ID::R32G32B32A32_UNORM;
return angle::Format::ID::R32G32B32A32_USCALED;
default:
UNREACHABLE();
#if !UNREACHABLE_IS_NORETURN
return VERTEX_FORMAT_INVALID;
return angle::Format::ID::NONE;
#endif
}
case GL_FLOAT:
switch (components)
{
case 1:
return VERTEX_FORMAT_FLOAT1;
return angle::Format::ID::R32_FLOAT;
case 2:
return VERTEX_FORMAT_FLOAT2;
return angle::Format::ID::R32G32_FLOAT;
case 3:
return VERTEX_FORMAT_FLOAT3;
return angle::Format::ID::R32G32B32_FLOAT;
case 4:
return VERTEX_FORMAT_FLOAT4;
return angle::Format::ID::R32G32B32A32_FLOAT;
default:
UNREACHABLE();
#if !UNREACHABLE_IS_NORETURN
return VERTEX_FORMAT_INVALID;
return angle::Format::ID::NONE;
#endif
}
case GL_HALF_FLOAT:
switch (components)
{
case 1:
return VERTEX_FORMAT_HALF1;
return angle::Format::ID::R16_FLOAT;
case 2:
return VERTEX_FORMAT_HALF2;
return angle::Format::ID::R16G16_FLOAT;
case 3:
return VERTEX_FORMAT_HALF3;
return angle::Format::ID::R16G16B16_FLOAT;
case 4:
return VERTEX_FORMAT_HALF4;
return angle::Format::ID::R16G16B16A16_FLOAT;
default:
UNREACHABLE();
#if !UNREACHABLE_IS_NORETURN
return VERTEX_FORMAT_INVALID;
return angle::Format::ID::NONE;
#endif
}
case GL_FIXED:
switch (components)
{
case 1:
return VERTEX_FORMAT_FIXED1;
return angle::Format::ID::R32_FIXED;
case 2:
return VERTEX_FORMAT_FIXED2;
return angle::Format::ID::R32G32_FIXED;
case 3:
return VERTEX_FORMAT_FIXED3;
return angle::Format::ID::R32G32B32_FIXED;
case 4:
return VERTEX_FORMAT_FIXED4;
return angle::Format::ID::R32G32B32A32_FIXED;
default:
UNREACHABLE();
#if !UNREACHABLE_IS_NORETURN
return VERTEX_FORMAT_INVALID;
return angle::Format::ID::NONE;
#endif
}
case GL_INT_2_10_10_10_REV:
if (pureInteger)
return VERTEX_FORMAT_SINT210_INT;
return angle::Format::ID::R10G10B10A2_SINT;
if (normalized)
return VERTEX_FORMAT_SINT210_NORM;
return VERTEX_FORMAT_SINT210;
return angle::Format::ID::R10G10B10A2_SNORM;
return angle::Format::ID::R10G10B10A2_SSCALED;
case GL_UNSIGNED_INT_2_10_10_10_REV:
if (pureInteger)
return VERTEX_FORMAT_UINT210_INT;
return angle::Format::ID::R10G10B10A2_UINT;
if (normalized)
return VERTEX_FORMAT_UINT210_NORM;
return VERTEX_FORMAT_UINT210;
return angle::Format::ID::R10G10B10A2_UNORM;
return angle::Format::ID::R10G10B10A2_USCALED;
default:
UNREACHABLE();
#if !UNREACHABLE_IS_NORETURN
return VERTEX_FORMAT_INVALID;
return angle::Format::ID::NONE;
#endif
}
}
angle::Format::ID GetVertexFormatID(const VertexAttribute &attrib)
{
return GetVertexFormatID(attrib.type, attrib.normalized, attrib.size, attrib.pureInteger);
}
// TODO(fjhenigman): Do away with VertexFormatType; use angle::Format::ID instead. anglebug.com/2531
VertexFormatType GetVertexFormatType(GLenum type,
GLboolean normalized,
GLuint components,
bool pureInteger)
{
switch (GetVertexFormatID(type, normalized, components, pureInteger))
{
case angle::Format::ID::R8_SINT:
return VERTEX_FORMAT_SBYTE1_INT;
case angle::Format::ID::R8_SNORM:
return VERTEX_FORMAT_SBYTE1_NORM;
case angle::Format::ID::R8_SSCALED:
return VERTEX_FORMAT_SBYTE1;
case angle::Format::ID::R8G8_SINT:
return VERTEX_FORMAT_SBYTE2_INT;
case angle::Format::ID::R8G8_SNORM:
return VERTEX_FORMAT_SBYTE2_NORM;
case angle::Format::ID::R8G8_SSCALED:
return VERTEX_FORMAT_SBYTE2;
case angle::Format::ID::R8G8B8_SINT:
return VERTEX_FORMAT_SBYTE3_INT;
case angle::Format::ID::R8G8B8_SNORM:
return VERTEX_FORMAT_SBYTE3_NORM;
case angle::Format::ID::R8G8B8_SSCALED:
return VERTEX_FORMAT_SBYTE3;
case angle::Format::ID::R8G8B8A8_SINT:
return VERTEX_FORMAT_SBYTE4_INT;
case angle::Format::ID::R8G8B8A8_SNORM:
return VERTEX_FORMAT_SBYTE4_NORM;
case angle::Format::ID::R8G8B8A8_SSCALED:
return VERTEX_FORMAT_SBYTE4;
case angle::Format::ID::R8_UINT:
return VERTEX_FORMAT_UBYTE1_INT;
case angle::Format::ID::R8_UNORM:
return VERTEX_FORMAT_UBYTE1_NORM;
case angle::Format::ID::R8_USCALED:
return VERTEX_FORMAT_UBYTE1;
case angle::Format::ID::R8G8_UINT:
return VERTEX_FORMAT_UBYTE2_INT;
case angle::Format::ID::R8G8_UNORM:
return VERTEX_FORMAT_UBYTE2_NORM;
case angle::Format::ID::R8G8_USCALED:
return VERTEX_FORMAT_UBYTE2;
case angle::Format::ID::R8G8B8_UINT:
return VERTEX_FORMAT_UBYTE3_INT;
case angle::Format::ID::R8G8B8_UNORM:
return VERTEX_FORMAT_UBYTE3_NORM;
case angle::Format::ID::R8G8B8_USCALED:
return VERTEX_FORMAT_UBYTE3;
case angle::Format::ID::R8G8B8A8_UINT:
return VERTEX_FORMAT_UBYTE4_INT;
case angle::Format::ID::R8G8B8A8_UNORM:
return VERTEX_FORMAT_UBYTE4_NORM;
case angle::Format::ID::R8G8B8A8_USCALED:
return VERTEX_FORMAT_UBYTE4;
case angle::Format::ID::R16_SINT:
return VERTEX_FORMAT_SSHORT1_INT;
case angle::Format::ID::R16_SNORM:
return VERTEX_FORMAT_SSHORT1_NORM;
case angle::Format::ID::R16_SSCALED:
return VERTEX_FORMAT_SSHORT1;
case angle::Format::ID::R16G16_SINT:
return VERTEX_FORMAT_SSHORT2_INT;
case angle::Format::ID::R16G16_SNORM:
return VERTEX_FORMAT_SSHORT2_NORM;
case angle::Format::ID::R16G16_SSCALED:
return VERTEX_FORMAT_SSHORT2;
case angle::Format::ID::R16G16B16_SINT:
return VERTEX_FORMAT_SSHORT3_INT;
case angle::Format::ID::R16G16B16_SNORM:
return VERTEX_FORMAT_SSHORT3_NORM;
case angle::Format::ID::R16G16B16_SSCALED:
return VERTEX_FORMAT_SSHORT3;
case angle::Format::ID::R16G16B16A16_SINT:
return VERTEX_FORMAT_SSHORT4_INT;
case angle::Format::ID::R16G16B16A16_SNORM:
return VERTEX_FORMAT_SSHORT4_NORM;
case angle::Format::ID::R16G16B16A16_SSCALED:
return VERTEX_FORMAT_SSHORT4;
case angle::Format::ID::R16_UINT:
return VERTEX_FORMAT_USHORT1_INT;
case angle::Format::ID::R16_UNORM:
return VERTEX_FORMAT_USHORT1_NORM;
case angle::Format::ID::R16_USCALED:
return VERTEX_FORMAT_USHORT1;
case angle::Format::ID::R16G16_UINT:
return VERTEX_FORMAT_USHORT2_INT;
case angle::Format::ID::R16G16_UNORM:
return VERTEX_FORMAT_USHORT2_NORM;
case angle::Format::ID::R16G16_USCALED:
return VERTEX_FORMAT_USHORT2;
case angle::Format::ID::R16G16B16_UINT:
return VERTEX_FORMAT_USHORT3_INT;
case angle::Format::ID::R16G16B16_UNORM:
return VERTEX_FORMAT_USHORT3_NORM;
case angle::Format::ID::R16G16B16_USCALED:
return VERTEX_FORMAT_USHORT3;
case angle::Format::ID::R16G16B16A16_UINT:
return VERTEX_FORMAT_USHORT4_INT;
case angle::Format::ID::R16G16B16A16_UNORM:
return VERTEX_FORMAT_USHORT4_NORM;
case angle::Format::ID::R16G16B16A16_USCALED:
return VERTEX_FORMAT_USHORT4;
case angle::Format::ID::R32_SINT:
return VERTEX_FORMAT_SINT1_INT;
case angle::Format::ID::R32_SNORM:
return VERTEX_FORMAT_SINT1_NORM;
case angle::Format::ID::R32_SSCALED:
return VERTEX_FORMAT_SINT1;
case angle::Format::ID::R32G32_SINT:
return VERTEX_FORMAT_SINT2_INT;
case angle::Format::ID::R32G32_SNORM:
return VERTEX_FORMAT_SINT2_NORM;
case angle::Format::ID::R32G32_SSCALED:
return VERTEX_FORMAT_SINT2;
case angle::Format::ID::R32G32B32_SINT:
return VERTEX_FORMAT_SINT3_INT;
case angle::Format::ID::R32G32B32_SNORM:
return VERTEX_FORMAT_SINT3_NORM;
case angle::Format::ID::R32G32B32_SSCALED:
return VERTEX_FORMAT_SINT3;
case angle::Format::ID::R32G32B32A32_SINT:
return VERTEX_FORMAT_SINT4_INT;
case angle::Format::ID::R32G32B32A32_SNORM:
return VERTEX_FORMAT_SINT4_NORM;
case angle::Format::ID::R32G32B32A32_SSCALED:
return VERTEX_FORMAT_SINT4;
case angle::Format::ID::R32_UINT:
return VERTEX_FORMAT_UINT1_INT;
case angle::Format::ID::R32_UNORM:
return VERTEX_FORMAT_UINT1_NORM;
case angle::Format::ID::R32_USCALED:
return VERTEX_FORMAT_UINT1;
case angle::Format::ID::R32G32_UINT:
return VERTEX_FORMAT_UINT2_INT;
case angle::Format::ID::R32G32_UNORM:
return VERTEX_FORMAT_UINT2_NORM;
case angle::Format::ID::R32G32_USCALED:
return VERTEX_FORMAT_UINT2;
case angle::Format::ID::R32G32B32_UINT:
return VERTEX_FORMAT_UINT3_INT;
case angle::Format::ID::R32G32B32_UNORM:
return VERTEX_FORMAT_UINT3_NORM;
case angle::Format::ID::R32G32B32_USCALED:
return VERTEX_FORMAT_UINT3;
case angle::Format::ID::R32G32B32A32_UINT:
return VERTEX_FORMAT_UINT4_INT;
case angle::Format::ID::R32G32B32A32_UNORM:
return VERTEX_FORMAT_UINT4_NORM;
case angle::Format::ID::R32G32B32A32_USCALED:
return VERTEX_FORMAT_UINT4;
case angle::Format::ID::R32_FLOAT:
return VERTEX_FORMAT_FLOAT1;
case angle::Format::ID::R32G32_FLOAT:
return VERTEX_FORMAT_FLOAT2;
case angle::Format::ID::R32G32B32_FLOAT:
return VERTEX_FORMAT_FLOAT3;
case angle::Format::ID::R32G32B32A32_FLOAT:
return VERTEX_FORMAT_FLOAT4;
case angle::Format::ID::R16_FLOAT:
return VERTEX_FORMAT_HALF1;
case angle::Format::ID::R16G16_FLOAT:
return VERTEX_FORMAT_HALF2;
case angle::Format::ID::R16G16B16_FLOAT:
return VERTEX_FORMAT_HALF3;
case angle::Format::ID::R16G16B16A16_FLOAT:
return VERTEX_FORMAT_HALF4;
case angle::Format::ID::R32_FIXED:
return VERTEX_FORMAT_FIXED1;
case angle::Format::ID::R32G32_FIXED:
return VERTEX_FORMAT_FIXED2;
case angle::Format::ID::R32G32B32_FIXED:
return VERTEX_FORMAT_FIXED3;
case angle::Format::ID::R32G32B32A32_FIXED:
return VERTEX_FORMAT_FIXED4;
case angle::Format::ID::R10G10B10A2_SINT:
return VERTEX_FORMAT_SINT210_INT;
case angle::Format::ID::R10G10B10A2_SNORM:
return VERTEX_FORMAT_SINT210_NORM;
case angle::Format::ID::R10G10B10A2_SSCALED:
return VERTEX_FORMAT_SINT210;
case angle::Format::ID::R10G10B10A2_UINT:
return VERTEX_FORMAT_UINT210_INT;
case angle::Format::ID::R10G10B10A2_UNORM:
return VERTEX_FORMAT_UINT210_NORM;
case angle::Format::ID::R10G10B10A2_USCALED:
return VERTEX_FORMAT_UINT210;
default:
return VERTEX_FORMAT_INVALID;
}
}
VertexFormatType GetVertexFormatType(const VertexAttribute &attrib)
{
return GetVertexFormatType(attrib.type, attrib.normalized, attrib.size, attrib.pureInteger);
......@@ -2153,14 +2350,14 @@ bool ValidES3InternalFormat(GLenum internalFormat)
return internalFormat != GL_NONE && formatMap.find(internalFormat) != formatMap.end();
}
VertexFormat::VertexFormat(GLenum typeIn, GLboolean normalizedIn, GLuint componentsIn, bool pureIntegerIn)
: type(typeIn),
normalized(normalizedIn),
components(componentsIn),
pureInteger(pureIntegerIn)
VertexFormat::VertexFormat(GLenum typeIn,
GLboolean normalizedIn,
GLuint componentsIn,
bool pureIntegerIn)
: type(typeIn), normalized(normalizedIn), components(componentsIn), pureInteger(pureIntegerIn)
{
// float -> !normalized
ASSERT(!(type == GL_FLOAT || type == GL_HALF_FLOAT || type == GL_FIXED) || normalized == GL_FALSE);
ASSERT(!(type == GL_FLOAT || type == GL_HALF_FLOAT || type == GL_FIXED) ||
normalized == GL_FALSE);
}
}
......@@ -9,9 +9,9 @@
#ifndef LIBANGLE_FORMATUTILS_H_
#define LIBANGLE_FORMATUTILS_H_
#include <stdint.h>
#include <cstddef>
#include <ostream>
#include <stdint.h>
#include "angle_gl.h"
#include "libANGLE/Caps.h"
......@@ -41,7 +41,8 @@ struct Type
Type();
GLuint bytes;
GLuint bytesShift; // Bit shift by this value to effectively divide/multiply by "bytes" in a more optimal way
GLuint bytesShift; // Bit shift by this value to effectively divide/multiply by "bytes" in a
// more optimal way
bool specialInterpretation;
};
const Type &GetTypeInfo(GLenum type);
......@@ -78,9 +79,9 @@ struct InternalFormat
bool is3D) const;
ErrorOrResult<GLuint> computePackUnpackEndByte(GLenum formatType,
const Extents &size,
const PixelStoreStateBase &state,
bool is3D) const;
const Extents &size,
const PixelStoreStateBase &state,
bool is3D) const;
bool isLUMA() const;
GLenum getReadPixelsFormat() const;
......@@ -307,7 +308,15 @@ struct VertexFormat : private angle::NonCopyable
bool pureInteger;
};
VertexFormatType GetVertexFormatType(GLenum type, GLboolean normalized, GLuint components, bool pureInteger);
angle::Format::ID GetVertexFormatID(GLenum type,
GLboolean normalized,
GLuint components,
bool pureInteger);
angle::Format::ID GetVertexFormatID(const VertexAttribute &attrib);
VertexFormatType GetVertexFormatType(GLenum type,
GLboolean normalized,
GLuint components,
bool pureInteger);
VertexFormatType GetVertexFormatType(const VertexAttribute &attrib);
VertexFormatType GetVertexFormatType(const VertexAttribute &attrib, GLenum currentValueType);
const VertexFormat &GetVertexFormatFromType(VertexFormatType vertexFormatType);
......@@ -327,4 +336,4 @@ bool ValidES3CopyConversion(GLenum textureFormat, GLenum framebufferFormat);
} // namespace gl
#endif // LIBANGLE_FORMATUTILS_H_
#endif // LIBANGLE_FORMATUTILS_H_
......@@ -85,68 +85,108 @@ enum class Format::ID
L32_FLOAT,
L8A8_UNORM,
L8_UNORM,
R10G10B10A2_SINT,
R10G10B10A2_SNORM,
R10G10B10A2_SSCALED,
R10G10B10A2_UINT,
R10G10B10A2_UNORM,
R10G10B10A2_USCALED,
R11G11B10_FLOAT,
R16G16B16A16_FLOAT,
R16G16B16A16_SINT,
R16G16B16A16_SNORM,
R16G16B16A16_SSCALED,
R16G16B16A16_UINT,
R16G16B16A16_UNORM,
R16G16B16A16_USCALED,
R16G16B16_FLOAT,
R16G16B16_SINT,
R16G16B16_SNORM,
R16G16B16_SSCALED,
R16G16B16_UINT,
R16G16B16_UNORM,
R16G16B16_USCALED,
R16G16_FLOAT,
R16G16_SINT,
R16G16_SNORM,
R16G16_SSCALED,
R16G16_UINT,
R16G16_UNORM,
R16G16_USCALED,
R16_FLOAT,
R16_SINT,
R16_SNORM,
R16_SSCALED,
R16_UINT,
R16_UNORM,
R16_USCALED,
R32G32B32A32_FIXED,
R32G32B32A32_FLOAT,
R32G32B32A32_SINT,
R32G32B32A32_SNORM,
R32G32B32A32_SSCALED,
R32G32B32A32_UINT,
R32G32B32A32_UNORM,
R32G32B32A32_USCALED,
R32G32B32_FIXED,
R32G32B32_FLOAT,
R32G32B32_SINT,
R32G32B32_SNORM,
R32G32B32_SSCALED,
R32G32B32_UINT,
R32G32B32_UNORM,
R32G32B32_USCALED,
R32G32_FIXED,
R32G32_FLOAT,
R32G32_SINT,
R32G32_SNORM,
R32G32_SSCALED,
R32G32_UINT,
R32G32_UNORM,
R32G32_USCALED,
R32_FIXED,
R32_FLOAT,
R32_SINT,
R32_SNORM,
R32_SSCALED,
R32_UINT,
R32_UNORM,
R32_USCALED,
R4G4B4A4_UNORM,
R5G5B5A1_UNORM,
R5G6B5_UNORM,
R8G8B8A8_SINT,
R8G8B8A8_SNORM,
R8G8B8A8_SSCALED,
R8G8B8A8_TYPELESS,
R8G8B8A8_TYPELESS_SRGB,
R8G8B8A8_UINT,
R8G8B8A8_UNORM,
R8G8B8A8_UNORM_SRGB,
R8G8B8A8_USCALED,
R8G8B8_SINT,
R8G8B8_SNORM,
R8G8B8_SSCALED,
R8G8B8_UINT,
R8G8B8_UNORM,
R8G8B8_UNORM_SRGB,
R8G8B8_USCALED,
R8G8_SINT,
R8G8_SNORM,
R8G8_SSCALED,
R8G8_UINT,
R8G8_UNORM,
R8G8_USCALED,
R8_SINT,
R8_SNORM,
R8_SSCALED,
R8_UINT,
R8_UNORM,
R8_USCALED,
R9G9B9E5_SHAREDEXP,
S8_UINT
};
constexpr uint32_t kNumANGLEFormats = 133;
constexpr uint32_t kNumANGLEFormats = 173;
} // namespace angle
......@@ -97,64 +97,104 @@ constexpr Format g_formatInfoTable[] = {
{ Format::ID::L32_FLOAT, GL_LUMINANCE32F_EXT, GL_LUMINANCE32F_EXT, GenerateMip<L32F>, NoCopyFunctions, ReadColor<L32F, GLfloat>, WriteColor<L32F, GLfloat>, GL_FLOAT, 0, 0, 0, 0, 0, 0, 0, false },
{ Format::ID::L8A8_UNORM, GL_LUMINANCE8_ALPHA8_EXT, GL_LUMINANCE8_ALPHA8_EXT, GenerateMip<L8A8>, NoCopyFunctions, ReadColor<L8A8, GLfloat>, WriteColor<L8A8, GLfloat>, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 8, 0, 0, 1, false },
{ Format::ID::L8_UNORM, GL_LUMINANCE8_EXT, GL_LUMINANCE8_EXT, GenerateMip<L8>, NoCopyFunctions, ReadColor<L8, GLfloat>, WriteColor<L8, GLfloat>, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, false },
{ Format::ID::R10G10B10A2_SINT, GL_RGB10_A2_SINT_ANGLEX, GL_RGB10_A2_SINT_ANGLEX, GenerateMip<R10G10B10A2S>, NoCopyFunctions, ReadColor<R10G10B10A2S, GLint>, WriteColor<R10G10B10A2S, GLint>, GL_INT, 10, 10, 10, 2, 0, 0, 4, false },
{ Format::ID::R10G10B10A2_SNORM, GL_RGB10_A2_SNORM_ANGLEX, GL_RGB10_A2_SNORM_ANGLEX, GenerateMip<R10G10B10A2S>, NoCopyFunctions, ReadColor<R10G10B10A2S, GLfloat>, WriteColor<R10G10B10A2S, GLfloat>, GL_SIGNED_NORMALIZED, 10, 10, 10, 2, 0, 0, 4, false },
{ Format::ID::R10G10B10A2_SSCALED, GL_RGB10_A2_SSCALED_ANGLEX, GL_RGB10_A2_SSCALED_ANGLEX, GenerateMip<R10G10B10A2S>, NoCopyFunctions, ReadColor<R10G10B10A2S, GLint>, WriteColor<R10G10B10A2S, GLint>, GL_INT, 10, 10, 10, 2, 0, 0, 4, false },
{ Format::ID::R10G10B10A2_UINT, GL_RGB10_A2UI, GL_RGB10_A2UI, GenerateMip<R10G10B10A2>, NoCopyFunctions, ReadColor<R10G10B10A2, GLuint>, WriteColor<R10G10B10A2, GLuint>, GL_UNSIGNED_INT, 10, 10, 10, 2, 0, 0, 4, false },
{ Format::ID::R10G10B10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, GenerateMip<R10G10B10A2>, NoCopyFunctions, ReadColor<R10G10B10A2, GLfloat>, WriteColor<R10G10B10A2, GLfloat>, GL_UNSIGNED_NORMALIZED, 10, 10, 10, 2, 0, 0, 4, false },
{ Format::ID::R10G10B10A2_USCALED, GL_RGB10_A2_USCALED_ANGLEX, GL_RGB10_A2_USCALED_ANGLEX, GenerateMip<R10G10B10A2>, NoCopyFunctions, ReadColor<R10G10B10A2, GLuint>, WriteColor<R10G10B10A2, GLuint>, GL_UNSIGNED_INT, 10, 10, 10, 2, 0, 0, 4, false },
{ Format::ID::R11G11B10_FLOAT, GL_R11F_G11F_B10F, GL_R11F_G11F_B10F, GenerateMip<R11G11B10F>, NoCopyFunctions, ReadColor<R11G11B10F, GLfloat>, WriteColor<R11G11B10F, GLfloat>, GL_FLOAT, 11, 11, 10, 0, 0, 0, 4, false },
{ Format::ID::R16G16B16A16_FLOAT, GL_RGBA16F, GL_RGBA16F, GenerateMip<R16G16B16A16F>, NoCopyFunctions, ReadColor<R16G16B16A16F, GLfloat>, WriteColor<R16G16B16A16F, GLfloat>, GL_FLOAT, 16, 16, 16, 16, 0, 0, 8, false },
{ Format::ID::R16G16B16A16_SINT, GL_RGBA16I, GL_RGBA16I, GenerateMip<R16G16B16A16S>, NoCopyFunctions, ReadColor<R16G16B16A16S, GLint>, WriteColor<R16G16B16A16S, GLint>, GL_INT, 16, 16, 16, 16, 0, 0, 8, false },
{ Format::ID::R16G16B16A16_SNORM, GL_RGBA16_SNORM_EXT, GL_RGBA16_SNORM_EXT, GenerateMip<R16G16B16A16S>, NoCopyFunctions, ReadColor<R16G16B16A16S, GLfloat>, WriteColor<R16G16B16A16S, GLfloat>, GL_SIGNED_NORMALIZED, 16, 16, 16, 16, 0, 0, 8, false },
{ Format::ID::R16G16B16A16_SSCALED, GL_RGBA16_SSCALED_ANGLEX, GL_RGBA16_SSCALED_ANGLEX, GenerateMip<R16G16B16A16S>, NoCopyFunctions, ReadColor<R16G16B16A16S, GLint>, WriteColor<R16G16B16A16S, GLint>, GL_INT, 16, 16, 16, 16, 0, 0, 8, false },
{ Format::ID::R16G16B16A16_UINT, GL_RGBA16UI, GL_RGBA16UI, GenerateMip<R16G16B16A16>, NoCopyFunctions, ReadColor<R16G16B16A16, GLuint>, WriteColor<R16G16B16A16, GLuint>, GL_UNSIGNED_INT, 16, 16, 16, 16, 0, 0, 8, false },
{ Format::ID::R16G16B16A16_UNORM, GL_RGBA16_EXT, GL_RGBA16_EXT, GenerateMip<R16G16B16A16>, NoCopyFunctions, ReadColor<R16G16B16A16, GLfloat>, WriteColor<R16G16B16A16, GLfloat>, GL_UNSIGNED_NORMALIZED, 16, 16, 16, 16, 0, 0, 8, false },
{ Format::ID::R16G16B16A16_USCALED, GL_RGBA16_USCALED_ANGLEX, GL_RGBA16_USCALED_ANGLEX, GenerateMip<R16G16B16A16>, NoCopyFunctions, ReadColor<R16G16B16A16, GLuint>, WriteColor<R16G16B16A16, GLuint>, GL_UNSIGNED_INT, 16, 16, 16, 16, 0, 0, 8, false },
{ Format::ID::R16G16B16_FLOAT, GL_RGB16F, GL_RGB16F, GenerateMip<R16G16B16F>, NoCopyFunctions, ReadColor<R16G16B16F, GLfloat>, WriteColor<R16G16B16F, GLfloat>, GL_FLOAT, 16, 16, 16, 0, 0, 0, 6, false },
{ Format::ID::R16G16B16_SINT, GL_RGB16I, GL_RGB16I, GenerateMip<R16G16B16S>, NoCopyFunctions, ReadColor<R16G16B16S, GLint>, WriteColor<R16G16B16S, GLint>, GL_INT, 16, 16, 16, 0, 0, 0, 6, false },
{ Format::ID::R16G16B16_SNORM, GL_RGB16_SNORM_EXT, GL_RGB16_SNORM_EXT, GenerateMip<R16G16B16S>, NoCopyFunctions, ReadColor<R16G16B16S, GLfloat>, WriteColor<R16G16B16S, GLfloat>, GL_SIGNED_NORMALIZED, 16, 16, 16, 0, 0, 0, 6, false },
{ Format::ID::R16G16B16_SSCALED, GL_RGB16_SSCALED_ANGLEX, GL_RGB16_SSCALED_ANGLEX, GenerateMip<R16G16B16S>, NoCopyFunctions, ReadColor<R16G16B16S, GLint>, WriteColor<R16G16B16S, GLint>, GL_INT, 16, 16, 16, 0, 0, 0, 6, false },
{ Format::ID::R16G16B16_UINT, GL_RGB16UI, GL_RGB16UI, GenerateMip<R16G16B16>, NoCopyFunctions, ReadColor<R16G16B16, GLuint>, WriteColor<R16G16B16, GLuint>, GL_UNSIGNED_INT, 16, 16, 16, 0, 0, 0, 6, false },
{ Format::ID::R16G16B16_UNORM, GL_RGB16_EXT, GL_RGB16_EXT, GenerateMip<R16G16B16>, NoCopyFunctions, ReadColor<R16G16B16, GLfloat>, WriteColor<R16G16B16, GLfloat>, GL_UNSIGNED_NORMALIZED, 16, 16, 16, 0, 0, 0, 6, false },
{ Format::ID::R16G16B16_USCALED, GL_RGB16_USCALED_ANGLEX, GL_RGB16_USCALED_ANGLEX, GenerateMip<R16G16B16>, NoCopyFunctions, ReadColor<R16G16B16, GLuint>, WriteColor<R16G16B16, GLuint>, GL_UNSIGNED_INT, 16, 16, 16, 0, 0, 0, 6, false },
{ Format::ID::R16G16_FLOAT, GL_RG16F, GL_RG16F, GenerateMip<R16G16F>, NoCopyFunctions, ReadColor<R16G16F, GLfloat>, WriteColor<R16G16F, GLfloat>, GL_FLOAT, 16, 16, 0, 0, 0, 0, 4, false },
{ Format::ID::R16G16_SINT, GL_RG16I, GL_RG16I, GenerateMip<R16G16S>, NoCopyFunctions, ReadColor<R16G16S, GLint>, WriteColor<R16G16S, GLint>, GL_INT, 16, 16, 0, 0, 0, 0, 4, false },
{ Format::ID::R16G16_SNORM, GL_RG16_SNORM_EXT, GL_RG16_SNORM_EXT, GenerateMip<R16G16S>, NoCopyFunctions, ReadColor<R16G16S, GLfloat>, WriteColor<R16G16S, GLfloat>, GL_SIGNED_NORMALIZED, 16, 16, 0, 0, 0, 0, 4, false },
{ Format::ID::R16G16_SSCALED, GL_RG16_SSCALED_ANGLEX, GL_RG16_SSCALED_ANGLEX, GenerateMip<R16G16S>, NoCopyFunctions, ReadColor<R16G16S, GLint>, WriteColor<R16G16S, GLint>, GL_INT, 16, 16, 0, 0, 0, 0, 4, false },
{ Format::ID::R16G16_UINT, GL_RG16UI, GL_RG16UI, GenerateMip<R16G16>, NoCopyFunctions, ReadColor<R16G16, GLuint>, WriteColor<R16G16, GLuint>, GL_UNSIGNED_INT, 16, 16, 0, 0, 0, 0, 4, false },
{ Format::ID::R16G16_UNORM, GL_RG16_EXT, GL_RG16_EXT, GenerateMip<R16G16>, NoCopyFunctions, ReadColor<R16G16, GLfloat>, WriteColor<R16G16, GLfloat>, GL_UNSIGNED_NORMALIZED, 16, 16, 0, 0, 0, 0, 4, false },
{ Format::ID::R16G16_USCALED, GL_RG16_USCALED_ANGLEX, GL_RG16_USCALED_ANGLEX, GenerateMip<R16G16>, NoCopyFunctions, ReadColor<R16G16, GLuint>, WriteColor<R16G16, GLuint>, GL_UNSIGNED_INT, 16, 16, 0, 0, 0, 0, 4, false },
{ Format::ID::R16_FLOAT, GL_R16F, GL_R16F, GenerateMip<R16F>, NoCopyFunctions, ReadColor<R16F, GLfloat>, WriteColor<R16F, GLfloat>, GL_FLOAT, 16, 0, 0, 0, 0, 0, 2, false },
{ Format::ID::R16_SINT, GL_R16I, GL_R16I, GenerateMip<R16S>, NoCopyFunctions, ReadColor<R16S, GLint>, WriteColor<R16S, GLint>, GL_INT, 16, 0, 0, 0, 0, 0, 2, false },
{ Format::ID::R16_SNORM, GL_R16_SNORM_EXT, GL_R16_SNORM_EXT, GenerateMip<R16S>, NoCopyFunctions, ReadColor<R16S, GLfloat>, WriteColor<R16S, GLfloat>, GL_SIGNED_NORMALIZED, 16, 0, 0, 0, 0, 0, 2, false },
{ Format::ID::R16_SSCALED, GL_R16_SSCALED_ANGLEX, GL_R16_SSCALED_ANGLEX, GenerateMip<R16S>, NoCopyFunctions, ReadColor<R16S, GLint>, WriteColor<R16S, GLint>, GL_INT, 16, 0, 0, 0, 0, 0, 2, false },
{ Format::ID::R16_UINT, GL_R16UI, GL_R16UI, GenerateMip<R16>, NoCopyFunctions, ReadColor<R16, GLuint>, WriteColor<R16, GLuint>, GL_UNSIGNED_INT, 16, 0, 0, 0, 0, 0, 2, false },
{ Format::ID::R16_UNORM, GL_R16_EXT, GL_R16_EXT, GenerateMip<R16>, NoCopyFunctions, ReadColor<R16, GLfloat>, WriteColor<R16, GLfloat>, GL_UNSIGNED_NORMALIZED, 16, 0, 0, 0, 0, 0, 2, false },
{ Format::ID::R16_USCALED, GL_R16_USCALED_ANGLEX, GL_R16_USCALED_ANGLEX, GenerateMip<R16>, NoCopyFunctions, ReadColor<R16, GLuint>, WriteColor<R16, GLuint>, GL_UNSIGNED_INT, 16, 0, 0, 0, 0, 0, 2, false },
{ Format::ID::R32G32B32A32_FIXED, GL_RGBA32_FIXED_ANGLEX, GL_RGBA32_FIXED_ANGLEX, GenerateMip<R32G32B32A32F>, NoCopyFunctions, ReadColor<R32G32B32A32F, GLfloat>, WriteColor<R32G32B32A32F, GLfloat>, GL_FLOAT, 32, 32, 32, 32, 0, 0, 16, false },
{ Format::ID::R32G32B32A32_FLOAT, GL_RGBA32F, GL_RGBA32F, GenerateMip<R32G32B32A32F>, NoCopyFunctions, ReadColor<R32G32B32A32F, GLfloat>, WriteColor<R32G32B32A32F, GLfloat>, GL_FLOAT, 32, 32, 32, 32, 0, 0, 16, false },
{ Format::ID::R32G32B32A32_SINT, GL_RGBA32I, GL_RGBA32I, GenerateMip<R32G32B32A32S>, NoCopyFunctions, ReadColor<R32G32B32A32S, GLint>, WriteColor<R32G32B32A32S, GLint>, GL_INT, 32, 32, 32, 32, 0, 0, 16, false },
{ Format::ID::R32G32B32A32_SNORM, GL_RGBA32_SNORM_ANGLEX, GL_RGBA32_SNORM_ANGLEX, GenerateMip<R32G32B32A32S>, NoCopyFunctions, ReadColor<R32G32B32A32S, GLfloat>, WriteColor<R32G32B32A32S, GLfloat>, GL_SIGNED_NORMALIZED, 32, 32, 32, 32, 0, 0, 16, false },
{ Format::ID::R32G32B32A32_SSCALED, GL_RGBA32_SSCALED_ANGLEX, GL_RGBA32_SSCALED_ANGLEX, GenerateMip<R32G32B32A32S>, NoCopyFunctions, ReadColor<R32G32B32A32S, GLint>, WriteColor<R32G32B32A32S, GLint>, GL_INT, 32, 32, 32, 32, 0, 0, 16, false },
{ Format::ID::R32G32B32A32_UINT, GL_RGBA32UI, GL_RGBA32UI, GenerateMip<R32G32B32A32>, NoCopyFunctions, ReadColor<R32G32B32A32, GLuint>, WriteColor<R32G32B32A32, GLuint>, GL_UNSIGNED_INT, 32, 32, 32, 32, 0, 0, 16, false },
{ Format::ID::R32G32B32A32_UNORM, GL_RGBA32_UNORM_ANGLEX, GL_RGBA32_UNORM_ANGLEX, GenerateMip<R32G32B32A32>, NoCopyFunctions, ReadColor<R32G32B32A32, GLfloat>, WriteColor<R32G32B32A32, GLfloat>, GL_UNSIGNED_NORMALIZED, 32, 32, 32, 32, 0, 0, 16, false },
{ Format::ID::R32G32B32A32_USCALED, GL_RGBA32_USCALED_ANGLEX, GL_RGBA32_USCALED_ANGLEX, GenerateMip<R32G32B32A32>, NoCopyFunctions, ReadColor<R32G32B32A32, GLuint>, WriteColor<R32G32B32A32, GLuint>, GL_UNSIGNED_INT, 32, 32, 32, 32, 0, 0, 16, false },
{ Format::ID::R32G32B32_FIXED, GL_RGB32_FIXED_ANGLEX, GL_RGB32_FIXED_ANGLEX, GenerateMip<R32G32B32F>, NoCopyFunctions, ReadColor<R32G32B32F, GLfloat>, WriteColor<R32G32B32F, GLfloat>, GL_FLOAT, 32, 32, 32, 0, 0, 0, 12, false },
{ Format::ID::R32G32B32_FLOAT, GL_RGB32F, GL_RGB32F, GenerateMip<R32G32B32F>, NoCopyFunctions, ReadColor<R32G32B32F, GLfloat>, WriteColor<R32G32B32F, GLfloat>, GL_FLOAT, 32, 32, 32, 0, 0, 0, 12, false },
{ Format::ID::R32G32B32_SINT, GL_RGB32I, GL_RGB32I, GenerateMip<R32G32B32S>, NoCopyFunctions, ReadColor<R32G32B32S, GLint>, WriteColor<R32G32B32S, GLint>, GL_INT, 32, 32, 32, 0, 0, 0, 12, false },
{ Format::ID::R32G32B32_SNORM, GL_RGB32_SNORM_ANGLEX, GL_RGB32_SNORM_ANGLEX, GenerateMip<R32G32B32S>, NoCopyFunctions, ReadColor<R32G32B32S, GLfloat>, WriteColor<R32G32B32S, GLfloat>, GL_SIGNED_NORMALIZED, 32, 32, 32, 0, 0, 0, 12, false },
{ Format::ID::R32G32B32_SSCALED, GL_RGB32_SSCALED_ANGLEX, GL_RGB32_SSCALED_ANGLEX, GenerateMip<R32G32B32S>, NoCopyFunctions, ReadColor<R32G32B32S, GLint>, WriteColor<R32G32B32S, GLint>, GL_INT, 32, 32, 32, 0, 0, 0, 12, false },
{ Format::ID::R32G32B32_UINT, GL_RGB32UI, GL_RGB32UI, GenerateMip<R32G32B32>, NoCopyFunctions, ReadColor<R32G32B32, GLuint>, WriteColor<R32G32B32, GLuint>, GL_UNSIGNED_INT, 32, 32, 32, 0, 0, 0, 12, false },
{ Format::ID::R32G32B32_UNORM, GL_RGB32_UNORM_ANGLEX, GL_RGB32_UNORM_ANGLEX, GenerateMip<R32G32B32>, NoCopyFunctions, ReadColor<R32G32B32, GLfloat>, WriteColor<R32G32B32, GLfloat>, GL_UNSIGNED_NORMALIZED, 32, 32, 32, 0, 0, 0, 12, false },
{ Format::ID::R32G32B32_USCALED, GL_RGB32_USCALED_ANGLEX, GL_RGB32_USCALED_ANGLEX, GenerateMip<R32G32B32>, NoCopyFunctions, ReadColor<R32G32B32, GLuint>, WriteColor<R32G32B32, GLuint>, GL_UNSIGNED_INT, 32, 32, 32, 0, 0, 0, 12, false },
{ Format::ID::R32G32_FIXED, GL_RG32_FIXED_ANGLEX, GL_RG32_FIXED_ANGLEX, GenerateMip<R32G32F>, NoCopyFunctions, ReadColor<R32G32F, GLfloat>, WriteColor<R32G32F, GLfloat>, GL_FLOAT, 32, 32, 0, 0, 0, 0, 8, false },
{ Format::ID::R32G32_FLOAT, GL_RG32F, GL_RG32F, GenerateMip<R32G32F>, NoCopyFunctions, ReadColor<R32G32F, GLfloat>, WriteColor<R32G32F, GLfloat>, GL_FLOAT, 32, 32, 0, 0, 0, 0, 8, false },
{ Format::ID::R32G32_SINT, GL_RG32I, GL_RG32I, GenerateMip<R32G32S>, NoCopyFunctions, ReadColor<R32G32S, GLint>, WriteColor<R32G32S, GLint>, GL_INT, 32, 32, 0, 0, 0, 0, 8, false },
{ Format::ID::R32G32_SNORM, GL_RG32_SNORM_ANGLEX, GL_RG32_SNORM_ANGLEX, GenerateMip<R32G32S>, NoCopyFunctions, ReadColor<R32G32S, GLfloat>, WriteColor<R32G32S, GLfloat>, GL_SIGNED_NORMALIZED, 32, 32, 0, 0, 0, 0, 8, false },
{ Format::ID::R32G32_SSCALED, GL_RG32_SSCALED_ANGLEX, GL_RG32_SSCALED_ANGLEX, GenerateMip<R32G32S>, NoCopyFunctions, ReadColor<R32G32S, GLint>, WriteColor<R32G32S, GLint>, GL_INT, 32, 32, 0, 0, 0, 0, 8, false },
{ Format::ID::R32G32_UINT, GL_RG32UI, GL_RG32UI, GenerateMip<R32G32>, NoCopyFunctions, ReadColor<R32G32, GLuint>, WriteColor<R32G32, GLuint>, GL_UNSIGNED_INT, 32, 32, 0, 0, 0, 0, 8, false },
{ Format::ID::R32G32_UNORM, GL_RG32_UNORM_ANGLEX, GL_RG32_UNORM_ANGLEX, GenerateMip<R32G32>, NoCopyFunctions, ReadColor<R32G32, GLfloat>, WriteColor<R32G32, GLfloat>, GL_UNSIGNED_NORMALIZED, 32, 32, 0, 0, 0, 0, 8, false },
{ Format::ID::R32G32_USCALED, GL_RG32_USCALED_ANGLEX, GL_RG32_USCALED_ANGLEX, GenerateMip<R32G32>, NoCopyFunctions, ReadColor<R32G32, GLuint>, WriteColor<R32G32, GLuint>, GL_UNSIGNED_INT, 32, 32, 0, 0, 0, 0, 8, false },
{ Format::ID::R32_FIXED, GL_R32_FIXED_ANGLEX, GL_R32_FIXED_ANGLEX, GenerateMip<R32F>, NoCopyFunctions, ReadColor<R32F, GLfloat>, WriteColor<R32F, GLfloat>, GL_FLOAT, 32, 0, 0, 0, 0, 0, 4, false },
{ Format::ID::R32_FLOAT, GL_R32F, GL_R32F, GenerateMip<R32F>, NoCopyFunctions, ReadColor<R32F, GLfloat>, WriteColor<R32F, GLfloat>, GL_FLOAT, 32, 0, 0, 0, 0, 0, 4, false },
{ Format::ID::R32_SINT, GL_R32I, GL_R32I, GenerateMip<R32S>, NoCopyFunctions, ReadColor<R32S, GLint>, WriteColor<R32S, GLint>, GL_INT, 32, 0, 0, 0, 0, 0, 4, false },
{ Format::ID::R32_SNORM, GL_R32_SNORM_ANGLEX, GL_R32_SNORM_ANGLEX, GenerateMip<R32S>, NoCopyFunctions, ReadColor<R32S, GLfloat>, WriteColor<R32S, GLfloat>, GL_SIGNED_NORMALIZED, 32, 0, 0, 0, 0, 0, 4, false },
{ Format::ID::R32_SSCALED, GL_R32_SSCALED_ANGLEX, GL_R32_SSCALED_ANGLEX, GenerateMip<R32S>, NoCopyFunctions, ReadColor<R32S, GLint>, WriteColor<R32S, GLint>, GL_INT, 32, 0, 0, 0, 0, 0, 4, false },
{ Format::ID::R32_UINT, GL_R32UI, GL_R32UI, GenerateMip<R32>, NoCopyFunctions, ReadColor<R32, GLuint>, WriteColor<R32, GLuint>, GL_UNSIGNED_INT, 32, 0, 0, 0, 0, 0, 4, false },
{ Format::ID::R32_UNORM, GL_R32_UNORM_ANGLEX, GL_R32_UNORM_ANGLEX, GenerateMip<R32>, NoCopyFunctions, ReadColor<R32, GLfloat>, WriteColor<R32, GLfloat>, GL_UNSIGNED_NORMALIZED, 32, 0, 0, 0, 0, 0, 4, false },
{ Format::ID::R32_USCALED, GL_R32_USCALED_ANGLEX, GL_R32_USCALED_ANGLEX, GenerateMip<R32>, NoCopyFunctions, ReadColor<R32, GLuint>, WriteColor<R32, GLuint>, GL_UNSIGNED_INT, 32, 0, 0, 0, 0, 0, 4, false },
{ Format::ID::R4G4B4A4_UNORM, GL_RGBA4, GL_RGBA4, GenerateMip<R4G4B4A4>, NoCopyFunctions, ReadColor<R4G4B4A4, GLfloat>, WriteColor<R4G4B4A4, GLfloat>, GL_UNSIGNED_NORMALIZED, 4, 4, 4, 4, 0, 0, 2, false },
{ Format::ID::R5G5B5A1_UNORM, GL_RGB5_A1, GL_RGB5_A1, GenerateMip<R5G5B5A1>, NoCopyFunctions, ReadColor<R5G5B5A1, GLfloat>, WriteColor<R5G5B5A1, GLfloat>, GL_UNSIGNED_NORMALIZED, 5, 5, 5, 1, 0, 0, 2, false },
{ Format::ID::R5G6B5_UNORM, GL_RGB565, GL_RGB565, GenerateMip<R5G6B5>, NoCopyFunctions, ReadColor<R5G6B5, GLfloat>, WriteColor<R5G6B5, GLfloat>, GL_UNSIGNED_NORMALIZED, 5, 6, 5, 0, 0, 0, 2, false },
{ Format::ID::R8G8B8A8_SINT, GL_RGBA8I, GL_RGBA8I, GenerateMip<R8G8B8A8S>, NoCopyFunctions, ReadColor<R8G8B8A8S, GLint>, WriteColor<R8G8B8A8S, GLint>, GL_INT, 8, 8, 8, 8, 0, 0, 4, false },
{ Format::ID::R8G8B8A8_SNORM, GL_RGBA8_SNORM, GL_RGBA8_SNORM, GenerateMip<R8G8B8A8S>, NoCopyFunctions, ReadColor<R8G8B8A8S, GLfloat>, WriteColor<R8G8B8A8S, GLfloat>, GL_SIGNED_NORMALIZED, 8, 8, 8, 8, 0, 0, 4, false },
{ Format::ID::R8G8B8A8_SSCALED, GL_RGBA8_SSCALED_ANGLEX, GL_RGBA8_SSCALED_ANGLEX, GenerateMip<R8G8B8A8S>, NoCopyFunctions, ReadColor<R8G8B8A8S, GLint>, WriteColor<R8G8B8A8S, GLint>, GL_INT, 8, 8, 8, 8, 0, 0, 4, false },
{ Format::ID::R8G8B8A8_TYPELESS, GL_RGBA8, GL_RGBA8, GenerateMip<R8G8B8A8>, NoCopyFunctions, ReadColor<R8G8B8A8, GLfloat>, WriteColor<R8G8B8A8, GLfloat>, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 8, 0, 0, 4, false },
{ Format::ID::R8G8B8A8_TYPELESS_SRGB, GL_SRGB8_ALPHA8, GL_SRGB8_ALPHA8, GenerateMip<R8G8B8A8>, NoCopyFunctions, ReadColor<R8G8B8A8, GLfloat>, WriteColor<R8G8B8A8, GLfloat>, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 8, 0, 0, 4, false },
{ Format::ID::R8G8B8A8_UINT, GL_RGBA8UI, GL_RGBA8UI, GenerateMip<R8G8B8A8>, NoCopyFunctions, ReadColor<R8G8B8A8, GLuint>, WriteColor<R8G8B8A8, GLuint>, GL_UNSIGNED_INT, 8, 8, 8, 8, 0, 0, 4, false },
{ Format::ID::R8G8B8A8_UNORM, GL_RGBA8, GL_RGBA8, GenerateMip<R8G8B8A8>, NoCopyFunctions, ReadColor<R8G8B8A8, GLfloat>, WriteColor<R8G8B8A8, GLfloat>, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 8, 0, 0, 4, false },
{ Format::ID::R8G8B8A8_UNORM_SRGB, GL_SRGB8_ALPHA8, GL_SRGB8_ALPHA8, GenerateMip<R8G8B8A8SRGB>, NoCopyFunctions, ReadColor<R8G8B8A8SRGB, GLfloat>, WriteColor<R8G8B8A8SRGB, GLfloat>, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 8, 0, 0, 4, false },
{ Format::ID::R8G8B8A8_USCALED, GL_RGBA8_USCALED_ANGLEX, GL_RGBA8_USCALED_ANGLEX, GenerateMip<R8G8B8A8>, NoCopyFunctions, ReadColor<R8G8B8A8, GLuint>, WriteColor<R8G8B8A8, GLuint>, GL_UNSIGNED_INT, 8, 8, 8, 8, 0, 0, 4, false },
{ Format::ID::R8G8B8_SINT, GL_RGB8I, GL_RGB8I, GenerateMip<R8G8B8S>, NoCopyFunctions, ReadColor<R8G8B8S, GLint>, WriteColor<R8G8B8S, GLint>, GL_INT, 8, 8, 8, 0, 0, 0, 3, false },
{ Format::ID::R8G8B8_SNORM, GL_RGB8_SNORM, GL_RGB8_SNORM, GenerateMip<R8G8B8S>, NoCopyFunctions, ReadColor<R8G8B8S, GLfloat>, WriteColor<R8G8B8S, GLfloat>, GL_SIGNED_NORMALIZED, 8, 8, 8, 0, 0, 0, 3, false },
{ Format::ID::R8G8B8_SSCALED, GL_RGB8_SSCALED_ANGLEX, GL_RGB8_SSCALED_ANGLEX, GenerateMip<R8G8B8S>, NoCopyFunctions, ReadColor<R8G8B8S, GLint>, WriteColor<R8G8B8S, GLint>, GL_INT, 8, 8, 8, 0, 0, 0, 3, false },
{ Format::ID::R8G8B8_UINT, GL_RGB8UI, GL_RGB8UI, GenerateMip<R8G8B8>, NoCopyFunctions, ReadColor<R8G8B8, GLuint>, WriteColor<R8G8B8, GLuint>, GL_UNSIGNED_INT, 8, 8, 8, 0, 0, 0, 3, false },
{ Format::ID::R8G8B8_UNORM, GL_RGB8, GL_RGB8, GenerateMip<R8G8B8>, NoCopyFunctions, ReadColor<R8G8B8, GLfloat>, WriteColor<R8G8B8, GLfloat>, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 0, 0, 0, 3, false },
{ Format::ID::R8G8B8_UNORM_SRGB, GL_SRGB8, GL_SRGB8, GenerateMip<R8G8B8>, NoCopyFunctions, ReadColor<R8G8B8, GLfloat>, WriteColor<R8G8B8, GLfloat>, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 0, 0, 0, 3, false },
{ Format::ID::R8G8B8_USCALED, GL_RGB8_USCALED_ANGLEX, GL_RGB8_USCALED_ANGLEX, GenerateMip<R8G8B8>, NoCopyFunctions, ReadColor<R8G8B8, GLuint>, WriteColor<R8G8B8, GLuint>, GL_UNSIGNED_INT, 8, 8, 8, 0, 0, 0, 3, false },
{ Format::ID::R8G8_SINT, GL_RG8I, GL_RG8I, GenerateMip<R8G8S>, NoCopyFunctions, ReadColor<R8G8S, GLint>, WriteColor<R8G8S, GLint>, GL_INT, 8, 8, 0, 0, 0, 0, 2, false },
{ Format::ID::R8G8_SNORM, GL_RG8_SNORM, GL_RG8_SNORM, GenerateMip<R8G8S>, NoCopyFunctions, ReadColor<R8G8S, GLfloat>, WriteColor<R8G8S, GLfloat>, GL_SIGNED_NORMALIZED, 8, 8, 0, 0, 0, 0, 2, false },
{ Format::ID::R8G8_SSCALED, GL_RG8_SSCALED_ANGLEX, GL_RG8_SSCALED_ANGLEX, GenerateMip<R8G8S>, NoCopyFunctions, ReadColor<R8G8S, GLint>, WriteColor<R8G8S, GLint>, GL_INT, 8, 8, 0, 0, 0, 0, 2, false },
{ Format::ID::R8G8_UINT, GL_RG8UI, GL_RG8UI, GenerateMip<R8G8>, NoCopyFunctions, ReadColor<R8G8, GLuint>, WriteColor<R8G8, GLuint>, GL_UNSIGNED_INT, 8, 8, 0, 0, 0, 0, 2, false },
{ Format::ID::R8G8_UNORM, GL_RG8, GL_RG8, GenerateMip<R8G8>, NoCopyFunctions, ReadColor<R8G8, GLfloat>, WriteColor<R8G8, GLfloat>, GL_UNSIGNED_NORMALIZED, 8, 8, 0, 0, 0, 0, 2, false },
{ Format::ID::R8G8_USCALED, GL_RG8_USCALED_ANGLEX, GL_RG8_USCALED_ANGLEX, GenerateMip<R8G8>, NoCopyFunctions, ReadColor<R8G8, GLuint>, WriteColor<R8G8, GLuint>, GL_UNSIGNED_INT, 8, 8, 0, 0, 0, 0, 2, false },
{ Format::ID::R8_SINT, GL_R8I, GL_R8I, GenerateMip<R8S>, NoCopyFunctions, ReadColor<R8S, GLint>, WriteColor<R8S, GLint>, GL_INT, 8, 0, 0, 0, 0, 0, 1, false },
{ Format::ID::R8_SNORM, GL_R8_SNORM, GL_R8_SNORM, GenerateMip<R8S>, NoCopyFunctions, ReadColor<R8S, GLfloat>, WriteColor<R8S, GLfloat>, GL_SIGNED_NORMALIZED, 8, 0, 0, 0, 0, 0, 1, false },
{ Format::ID::R8_SSCALED, GL_R8_SSCALED_ANGLEX, GL_R8_SSCALED_ANGLEX, GenerateMip<R8S>, NoCopyFunctions, ReadColor<R8S, GLint>, WriteColor<R8S, GLint>, GL_INT, 8, 0, 0, 0, 0, 0, 1, false },
{ Format::ID::R8_UINT, GL_R8UI, GL_R8UI, GenerateMip<R8>, NoCopyFunctions, ReadColor<R8, GLuint>, WriteColor<R8, GLuint>, GL_UNSIGNED_INT, 8, 0, 0, 0, 0, 0, 1, false },
{ Format::ID::R8_UNORM, GL_R8, GL_R8, GenerateMip<R8>, NoCopyFunctions, ReadColor<R8, GLfloat>, WriteColor<R8, GLfloat>, GL_UNSIGNED_NORMALIZED, 8, 0, 0, 0, 0, 0, 1, false },
{ Format::ID::R8_USCALED, GL_R8_USCALED_ANGLEX, GL_R8_USCALED_ANGLEX, GenerateMip<R8>, NoCopyFunctions, ReadColor<R8, GLuint>, WriteColor<R8, GLuint>, GL_UNSIGNED_INT, 8, 0, 0, 0, 0, 0, 1, false },
{ Format::ID::R9G9B9E5_SHAREDEXP, GL_RGB9_E5, GL_RGB9_E5, GenerateMip<R9G9B9E5>, NoCopyFunctions, ReadColor<R9G9B9E5, GLfloat>, WriteColor<R9G9B9E5, GLfloat>, GL_FLOAT, 9, 9, 9, 0, 0, 0, 3, false },
{ Format::ID::S8_UINT, GL_STENCIL_INDEX8, GL_STENCIL_INDEX8, nullptr, NoCopyFunctions, nullptr, nullptr, GL_UNSIGNED_INT, 0, 0, 0, 0, 0, 8, 1, false },
// clang-format on
......@@ -323,12 +363,26 @@ Format::ID Format::InternalFormatToID(GLenum internalFormat)
return Format::ID::R16_UNORM;
case GL_R16_SNORM_EXT:
return Format::ID::R16_SNORM;
case GL_R16_SSCALED_ANGLEX:
return Format::ID::R16_SSCALED;
case GL_R16_USCALED_ANGLEX:
return Format::ID::R16_USCALED;
case GL_R32F:
return Format::ID::R32_FLOAT;
case GL_R32I:
return Format::ID::R32_SINT;
case GL_R32UI:
return Format::ID::R32_UINT;
case GL_R32_FIXED_ANGLEX:
return Format::ID::R32_FIXED;
case GL_R32_SNORM_ANGLEX:
return Format::ID::R32_SNORM;
case GL_R32_SSCALED_ANGLEX:
return Format::ID::R32_SSCALED;
case GL_R32_UNORM_ANGLEX:
return Format::ID::R32_UNORM;
case GL_R32_USCALED_ANGLEX:
return Format::ID::R32_USCALED;
case GL_R8:
return Format::ID::R8_UNORM;
case GL_R8I:
......@@ -337,6 +391,10 @@ Format::ID Format::InternalFormatToID(GLenum internalFormat)
return Format::ID::R8_UINT;
case GL_R8_SNORM:
return Format::ID::R8_SNORM;
case GL_R8_SSCALED_ANGLEX:
return Format::ID::R8_SSCALED;
case GL_R8_USCALED_ANGLEX:
return Format::ID::R8_USCALED;
case GL_RG16F:
return Format::ID::R16G16_FLOAT;
case GL_RG16I:
......@@ -347,12 +405,26 @@ Format::ID Format::InternalFormatToID(GLenum internalFormat)
return Format::ID::R16G16_UNORM;
case GL_RG16_SNORM_EXT:
return Format::ID::R16G16_SNORM;
case GL_RG16_SSCALED_ANGLEX:
return Format::ID::R16G16_SSCALED;
case GL_RG16_USCALED_ANGLEX:
return Format::ID::R16G16_USCALED;
case GL_RG32F:
return Format::ID::R32G32_FLOAT;
case GL_RG32I:
return Format::ID::R32G32_SINT;
case GL_RG32UI:
return Format::ID::R32G32_UINT;
case GL_RG32_FIXED_ANGLEX:
return Format::ID::R32G32_FIXED;
case GL_RG32_SNORM_ANGLEX:
return Format::ID::R32G32_SNORM;
case GL_RG32_SSCALED_ANGLEX:
return Format::ID::R32G32_SSCALED;
case GL_RG32_UNORM_ANGLEX:
return Format::ID::R32G32_UNORM;
case GL_RG32_USCALED_ANGLEX:
return Format::ID::R32G32_USCALED;
case GL_RG8:
return Format::ID::R8G8_UNORM;
case GL_RG8I:
......@@ -361,12 +433,24 @@ Format::ID Format::InternalFormatToID(GLenum internalFormat)
return Format::ID::R8G8_UINT;
case GL_RG8_SNORM:
return Format::ID::R8G8_SNORM;
case GL_RG8_SSCALED_ANGLEX:
return Format::ID::R8G8_SSCALED;
case GL_RG8_USCALED_ANGLEX:
return Format::ID::R8G8_USCALED;
case GL_RGB:
return Format::ID::R8G8B8_UNORM;
case GL_RGB10_A2:
return Format::ID::R10G10B10A2_UNORM;
case GL_RGB10_A2UI:
return Format::ID::R10G10B10A2_UINT;
case GL_RGB10_A2_SINT_ANGLEX:
return Format::ID::R10G10B10A2_SINT;
case GL_RGB10_A2_SNORM_ANGLEX:
return Format::ID::R10G10B10A2_SNORM;
case GL_RGB10_A2_SSCALED_ANGLEX:
return Format::ID::R10G10B10A2_SSCALED;
case GL_RGB10_A2_USCALED_ANGLEX:
return Format::ID::R10G10B10A2_USCALED;
case GL_RGB16F:
return Format::ID::R16G16B16_FLOAT;
case GL_RGB16I:
......@@ -377,12 +461,26 @@ Format::ID Format::InternalFormatToID(GLenum internalFormat)
return Format::ID::R16G16B16_UNORM;
case GL_RGB16_SNORM_EXT:
return Format::ID::R16G16B16_SNORM;
case GL_RGB16_SSCALED_ANGLEX:
return Format::ID::R16G16B16_SSCALED;
case GL_RGB16_USCALED_ANGLEX:
return Format::ID::R16G16B16_USCALED;
case GL_RGB32F:
return Format::ID::R32G32B32_FLOAT;
case GL_RGB32I:
return Format::ID::R32G32B32_SINT;
case GL_RGB32UI:
return Format::ID::R32G32B32_UINT;
case GL_RGB32_FIXED_ANGLEX:
return Format::ID::R32G32B32_FIXED;
case GL_RGB32_SNORM_ANGLEX:
return Format::ID::R32G32B32_SNORM;
case GL_RGB32_SSCALED_ANGLEX:
return Format::ID::R32G32B32_SSCALED;
case GL_RGB32_UNORM_ANGLEX:
return Format::ID::R32G32B32_UNORM;
case GL_RGB32_USCALED_ANGLEX:
return Format::ID::R32G32B32_USCALED;
case GL_RGB565:
return Format::ID::R5G6B5_UNORM;
case GL_RGB5_A1:
......@@ -395,6 +493,10 @@ Format::ID Format::InternalFormatToID(GLenum internalFormat)
return Format::ID::R8G8B8_UINT;
case GL_RGB8_SNORM:
return Format::ID::R8G8B8_SNORM;
case GL_RGB8_SSCALED_ANGLEX:
return Format::ID::R8G8B8_SSCALED;
case GL_RGB8_USCALED_ANGLEX:
return Format::ID::R8G8B8_USCALED;
case GL_RGB9_E5:
return Format::ID::R9G9B9E5_SHAREDEXP;
case GL_RGBA:
......@@ -409,12 +511,26 @@ Format::ID Format::InternalFormatToID(GLenum internalFormat)
return Format::ID::R16G16B16A16_UNORM;
case GL_RGBA16_SNORM_EXT:
return Format::ID::R16G16B16A16_SNORM;
case GL_RGBA16_SSCALED_ANGLEX:
return Format::ID::R16G16B16A16_SSCALED;
case GL_RGBA16_USCALED_ANGLEX:
return Format::ID::R16G16B16A16_USCALED;
case GL_RGBA32F:
return Format::ID::R32G32B32A32_FLOAT;
case GL_RGBA32I:
return Format::ID::R32G32B32A32_SINT;
case GL_RGBA32UI:
return Format::ID::R32G32B32A32_UINT;
case GL_RGBA32_FIXED_ANGLEX:
return Format::ID::R32G32B32A32_FIXED;
case GL_RGBA32_SNORM_ANGLEX:
return Format::ID::R32G32B32A32_SNORM;
case GL_RGBA32_SSCALED_ANGLEX:
return Format::ID::R32G32B32A32_SSCALED;
case GL_RGBA32_UNORM_ANGLEX:
return Format::ID::R32G32B32A32_UNORM;
case GL_RGBA32_USCALED_ANGLEX:
return Format::ID::R32G32B32A32_USCALED;
case GL_RGBA4:
return Format::ID::R4G4B4A4_UNORM;
case GL_RGBA8:
......@@ -425,10 +541,14 @@ Format::ID Format::InternalFormatToID(GLenum internalFormat)
return Format::ID::R8G8B8A8_UINT;
case GL_RGBA8_SNORM:
return Format::ID::R8G8B8A8_SNORM;
case GL_RGBA8_SSCALED_ANGLEX:
return Format::ID::R8G8B8A8_SSCALED;
case GL_RGBA8_TYPELESS_ANGLEX:
return Format::ID::R8G8B8A8_TYPELESS;
case GL_RGBA8_TYPELESS_SRGB_ANGLEX:
return Format::ID::R8G8B8A8_TYPELESS_SRGB;
case GL_RGBA8_USCALED_ANGLEX:
return Format::ID::R8G8B8A8_USCALED;
case GL_SRGB8:
return Format::ID::R8G8B8_UNORM_SRGB;
case GL_SRGB8_ALPHA8:
......
......@@ -60,10 +60,16 @@ def get_component_type(format_id):
return "unorm"
elif "FLOAT" in format_id:
return "float"
elif "FIXED" in format_id:
return "float"
elif "UINT" in format_id:
return "uint"
elif "SINT" in format_id:
return "int"
elif "USCALED" in format_id:
return "uint"
elif "SSCALED" in format_id:
return "int"
elif format_id == "NONE":
return "none"
elif "SRGB" in format_id:
......
......@@ -93,6 +93,10 @@
[ "GL_RGB", "R8G8B8_UNORM" ],
[ "GL_RGB10_A2", "R10G10B10A2_UNORM" ],
[ "GL_RGB10_A2UI", "R10G10B10A2_UINT" ],
[ "GL_RGB10_A2_USCALED_ANGLEX", "R10G10B10A2_USCALED" ],
[ "GL_RGB10_A2_SNORM_ANGLEX", "R10G10B10A2_SNORM" ],
[ "GL_RGB10_A2_SINT_ANGLEX", "R10G10B10A2_SINT" ],
[ "GL_RGB10_A2_SSCALED_ANGLEX", "R10G10B10A2_SSCALED" ],
[ "GL_RGB16F", "R16G16B16_FLOAT" ],
[ "GL_RGB16I", "R16G16B16_SINT" ],
[ "GL_RGB16UI", "R16G16B16_UINT" ],
......@@ -133,5 +137,41 @@
[ "GL_RGBA8_TYPELESS_ANGLEX", "R8G8B8A8_TYPELESS" ],
[ "GL_RGBA8_TYPELESS_SRGB_ANGLEX", "R8G8B8A8_TYPELESS_SRGB" ],
[ "GL_BGRA8_TYPELESS_ANGLEX", "B8G8R8A8_TYPELESS" ],
[ "GL_BGRA8_TYPELESS_SRGB_ANGLEX", "B8G8R8A8_TYPELESS_SRGB" ]
[ "GL_BGRA8_TYPELESS_SRGB_ANGLEX", "B8G8R8A8_TYPELESS_SRGB" ],
[ "GL_R8_SSCALED_ANGLEX", "R8_SSCALED" ],
[ "GL_RG8_SSCALED_ANGLEX", "R8G8_SSCALED" ],
[ "GL_RGB8_SSCALED_ANGLEX", "R8G8B8_SSCALED" ],
[ "GL_RGBA8_SSCALED_ANGLEX", "R8G8B8A8_SSCALED" ],
[ "GL_R8_USCALED_ANGLEX", "R8_USCALED" ],
[ "GL_RG8_USCALED_ANGLEX", "R8G8_USCALED" ],
[ "GL_RGB8_USCALED_ANGLEX", "R8G8B8_USCALED" ],
[ "GL_RGBA8_USCALED_ANGLEX", "R8G8B8A8_USCALED" ],
[ "GL_R16_SSCALED_ANGLEX", "R16_SSCALED" ],
[ "GL_RG16_SSCALED_ANGLEX", "R16G16_SSCALED" ],
[ "GL_RGB16_SSCALED_ANGLEX", "R16G16B16_SSCALED" ],
[ "GL_RGBA16_SSCALED_ANGLEX", "R16G16B16A16_SSCALED" ],
[ "GL_R16_USCALED_ANGLEX", "R16_USCALED" ],
[ "GL_RG16_USCALED_ANGLEX", "R16G16_USCALED" ],
[ "GL_RGB16_USCALED_ANGLEX", "R16G16B16_USCALED" ],
[ "GL_RGBA16_USCALED_ANGLEX", "R16G16B16A16_USCALED" ],
[ "GL_R32_SNORM_ANGLEX", "R32_SNORM" ],
[ "GL_RG32_SNORM_ANGLEX", "R32G32_SNORM" ],
[ "GL_RGB32_SNORM_ANGLEX", "R32G32B32_SNORM" ],
[ "GL_RGBA32_SNORM_ANGLEX", "R32G32B32A32_SNORM" ],
[ "GL_R32_UNORM_ANGLEX", "R32_UNORM" ],
[ "GL_RG32_UNORM_ANGLEX", "R32G32_UNORM" ],
[ "GL_RGB32_UNORM_ANGLEX", "R32G32B32_UNORM" ],
[ "GL_RGBA32_UNORM_ANGLEX", "R32G32B32A32_UNORM" ],
[ "GL_R32_SSCALED_ANGLEX", "R32_SSCALED" ],
[ "GL_RG32_SSCALED_ANGLEX", "R32G32_SSCALED" ],
[ "GL_RGB32_SSCALED_ANGLEX", "R32G32B32_SSCALED" ],
[ "GL_RGBA32_SSCALED_ANGLEX", "R32G32B32A32_SSCALED" ],
[ "GL_R32_USCALED_ANGLEX", "R32_USCALED" ],
[ "GL_RG32_USCALED_ANGLEX", "R32G32_USCALED" ],
[ "GL_RGB32_USCALED_ANGLEX", "R32G32B32_USCALED" ],
[ "GL_RGBA32_USCALED_ANGLEX", "R32G32B32A32_USCALED" ],
[ "GL_R32_FIXED_ANGLEX", "R32_FIXED" ],
[ "GL_RG32_FIXED_ANGLEX", "R32G32_FIXED" ],
[ "GL_RGB32_FIXED_ANGLEX", "R32G32B32_FIXED" ],
[ "GL_RGBA32_FIXED_ANGLEX", "R32G32B32A32_FIXED" ]
]
......@@ -695,6 +695,18 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R10G10B10A2_SINT:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R10G10B10A2_SNORM:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R10G10B10A2_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R10G10B10A2_UINT:
// This format is not implemented in Vulkan.
break;
......@@ -703,6 +715,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R10G10B10A2_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R11G11B10_FLOAT:
// This format is not implemented in Vulkan.
break;
......@@ -740,6 +756,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R16G16B16A16_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R16G16B16A16_UINT:
{
internalFormat = GL_RGBA16UI;
......@@ -762,6 +782,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R16G16B16A16_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R16G16B16_FLOAT:
{
internalFormat = GL_RGB16F;
......@@ -795,6 +819,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R16G16B16_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R16G16B16_UINT:
{
internalFormat = GL_RGB16UI;
......@@ -817,6 +845,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R16G16B16_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R16G16_FLOAT:
{
internalFormat = GL_RG16F;
......@@ -850,6 +882,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R16G16_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R16G16_UINT:
{
internalFormat = GL_RG16UI;
......@@ -872,6 +908,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R16G16_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R16_FLOAT:
{
internalFormat = GL_R16F;
......@@ -905,6 +945,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R16_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R16_UINT:
{
internalFormat = GL_R16UI;
......@@ -927,6 +971,14 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R16_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32B32A32_FIXED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32B32A32_FLOAT:
{
internalFormat = GL_RGBA32F;
......@@ -949,6 +1001,14 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R32G32B32A32_SNORM:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32B32A32_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32B32A32_UINT:
{
internalFormat = GL_RGBA32UI;
......@@ -960,6 +1020,18 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R32G32B32A32_UNORM:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32B32A32_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32B32_FIXED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32B32_FLOAT:
{
internalFormat = GL_RGB32F;
......@@ -982,6 +1054,14 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R32G32B32_SNORM:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32B32_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32B32_UINT:
{
internalFormat = GL_RGB32UI;
......@@ -993,6 +1073,18 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R32G32B32_UNORM:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32B32_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32_FIXED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32_FLOAT:
{
internalFormat = GL_RG32F;
......@@ -1015,6 +1107,14 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R32G32_SNORM:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32_UINT:
{
internalFormat = GL_RG32UI;
......@@ -1026,6 +1126,18 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R32G32_UNORM:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32G32_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32_FIXED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32_FLOAT:
{
internalFormat = GL_R32F;
......@@ -1048,6 +1160,14 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R32_SNORM:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32_UINT:
{
internalFormat = GL_R32UI;
......@@ -1059,6 +1179,14 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R32_UNORM:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R32_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R4G4B4A4_UNORM:
{
internalFormat = GL_RGBA4;
......@@ -1114,6 +1242,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R8G8B8A8_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R8G8B8A8_TYPELESS:
// This format is not implemented in Vulkan.
break;
......@@ -1148,6 +1280,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R8G8B8A8_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R8G8B8_SINT:
{
internalFormat = GL_RGB8I;
......@@ -1170,6 +1306,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R8G8B8_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R8G8B8_UINT:
{
internalFormat = GL_RGB8UI;
......@@ -1196,6 +1336,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R8G8B8_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R8G8_SINT:
{
internalFormat = GL_RG8I;
......@@ -1218,6 +1362,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R8G8_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R8G8_UINT:
{
internalFormat = GL_RG8UI;
......@@ -1240,6 +1388,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R8G8_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R8_SINT:
{
internalFormat = GL_R8I;
......@@ -1262,6 +1414,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R8_SSCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R8_UINT:
{
internalFormat = GL_R8UI;
......@@ -1284,6 +1440,10 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break;
}
case angle::Format::ID::R8_USCALED:
// This format is not implemented in Vulkan.
break;
case angle::Format::ID::R9G9B9E5_SHAREDEXP:
// This format is not implemented in Vulkan.
break;
......
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