Added support for integer and unsigned integer texture formats.

TRAC #23049 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2373 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 36d0be90
......@@ -572,35 +572,35 @@ static InternalFormatInfoMap buildES3InternalFormatInfoMap()
map.insert(InternalFormatInfoPair(GL_RGBA8, InternalFormatInfo::RGBAFormat( 8, 8, 8, 8, 0, GL_RGBA, GL_UNSIGNED_BYTE, AlwaysSupported, AlwaysSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGBA8_SNORM, InternalFormatInfo::RGBAFormat( 8, 8, 8, 8, 0, GL_RGBA, GL_BYTE, NeverSupported, AlwaysSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGB10_A2, InternalFormatInfo::RGBAFormat(10, 10, 10, 2, 0, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, AlwaysSupported, AlwaysSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGB10_A2UI, InternalFormatInfo::RGBAFormat(10, 10, 10, 2, 0, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGB10_A2UI, InternalFormatInfo::RGBAFormat(10, 10, 10, 2, 0, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_SRGB8, InternalFormatInfo::RGBAFormat( 8, 8, 8, 0, 0, GL_RGB, GL_UNSIGNED_BYTE, NeverSupported, AlwaysSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_SRGB8_ALPHA8, InternalFormatInfo::RGBAFormat( 8, 8, 8, 8, 0, GL_RGBA, GL_UNSIGNED_BYTE, AlwaysSupported, AlwaysSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_R11F_G11F_B10F, InternalFormatInfo::RGBAFormat(11, 11, 10, 0, 0, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, NeverSupported, AlwaysSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGB9_E5, InternalFormatInfo::RGBAFormat( 9, 9, 9, 0, 5, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV, NeverSupported, AlwaysSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_R8I, InternalFormatInfo::RGBAFormat( 8, 0, 0, 0, 0, GL_RED_INTEGER, GL_BYTE, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_R8UI, InternalFormatInfo::RGBAFormat( 8, 0, 0, 0, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_R16I, InternalFormatInfo::RGBAFormat(16, 0, 0, 0, 0, GL_RED_INTEGER, GL_SHORT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_R16UI, InternalFormatInfo::RGBAFormat(16, 0, 0, 0, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_R32I, InternalFormatInfo::RGBAFormat(32, 0, 0, 0, 0, GL_RED_INTEGER, GL_INT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_R32UI, InternalFormatInfo::RGBAFormat(32, 0, 0, 0, 0, GL_RED_INTEGER, GL_UNSIGNED_INT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RG8I, InternalFormatInfo::RGBAFormat( 8, 8, 0, 0, 0, GL_RG_INTEGER, GL_BYTE, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RG8UI, InternalFormatInfo::RGBAFormat( 8, 8, 0, 0, 0, GL_RG_INTEGER, GL_UNSIGNED_BYTE, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RG16I, InternalFormatInfo::RGBAFormat(16, 16, 0, 0, 0, GL_RG_INTEGER, GL_SHORT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RG16UI, InternalFormatInfo::RGBAFormat(16, 16, 0, 0, 0, GL_RG_INTEGER, GL_UNSIGNED_SHORT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RG32I, InternalFormatInfo::RGBAFormat(32, 32, 0, 0, 0, GL_RG_INTEGER, GL_INT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RG32UI, InternalFormatInfo::RGBAFormat(32, 32, 0, 0, 0, GL_RG_INTEGER, GL_UNSIGNED_INT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGB8I, InternalFormatInfo::RGBAFormat( 8, 8, 8, 0, 0, GL_RGB_INTEGER, GL_BYTE, NeverSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGB8UI, InternalFormatInfo::RGBAFormat( 8, 8, 8, 0, 0, GL_RGB_INTEGER, GL_UNSIGNED_BYTE, NeverSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGB16I, InternalFormatInfo::RGBAFormat(16, 16, 16, 0, 0, GL_RGB_INTEGER, GL_SHORT, NeverSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGB16UI, InternalFormatInfo::RGBAFormat(16, 16, 16, 0, 0, GL_RGB_INTEGER, GL_UNSIGNED_SHORT, NeverSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGB32I, InternalFormatInfo::RGBAFormat(32, 32, 32, 0, 0, GL_RGB_INTEGER, GL_INT, NeverSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGB32UI, InternalFormatInfo::RGBAFormat(32, 32, 32, 0, 0, GL_RGB_INTEGER, GL_UNSIGNED_INT, NeverSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGBA8I, InternalFormatInfo::RGBAFormat( 8, 8, 8, 8, 0, GL_RGBA_INTEGER, GL_BYTE, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGBA8UI, InternalFormatInfo::RGBAFormat( 8, 8, 8, 8, 0, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGBA16I, InternalFormatInfo::RGBAFormat(16, 16, 16, 16, 0, GL_RGBA_INTEGER, GL_SHORT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGBA16UI, InternalFormatInfo::RGBAFormat(16, 16, 16, 16, 0, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGBA32I, InternalFormatInfo::RGBAFormat(32, 32, 32, 32, 0, GL_RGBA_INTEGER, GL_INT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_RGBA32UI, InternalFormatInfo::RGBAFormat(32, 32, 32, 32, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, AlwaysSupported, NeverSupported, UnimplementedSupport)));
map.insert(InternalFormatInfoPair(GL_R8I, InternalFormatInfo::RGBAFormat( 8, 0, 0, 0, 0, GL_RED_INTEGER, GL_BYTE, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_R8UI, InternalFormatInfo::RGBAFormat( 8, 0, 0, 0, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_R16I, InternalFormatInfo::RGBAFormat(16, 0, 0, 0, 0, GL_RED_INTEGER, GL_SHORT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_R16UI, InternalFormatInfo::RGBAFormat(16, 0, 0, 0, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_R32I, InternalFormatInfo::RGBAFormat(32, 0, 0, 0, 0, GL_RED_INTEGER, GL_INT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_R32UI, InternalFormatInfo::RGBAFormat(32, 0, 0, 0, 0, GL_RED_INTEGER, GL_UNSIGNED_INT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RG8I, InternalFormatInfo::RGBAFormat( 8, 8, 0, 0, 0, GL_RG_INTEGER, GL_BYTE, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RG8UI, InternalFormatInfo::RGBAFormat( 8, 8, 0, 0, 0, GL_RG_INTEGER, GL_UNSIGNED_BYTE, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RG16I, InternalFormatInfo::RGBAFormat(16, 16, 0, 0, 0, GL_RG_INTEGER, GL_SHORT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RG16UI, InternalFormatInfo::RGBAFormat(16, 16, 0, 0, 0, GL_RG_INTEGER, GL_UNSIGNED_SHORT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RG32I, InternalFormatInfo::RGBAFormat(32, 32, 0, 0, 0, GL_RG_INTEGER, GL_INT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RG32UI, InternalFormatInfo::RGBAFormat(32, 32, 0, 0, 0, GL_RG_INTEGER, GL_UNSIGNED_INT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGB8I, InternalFormatInfo::RGBAFormat( 8, 8, 8, 0, 0, GL_RGB_INTEGER, GL_BYTE, NeverSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGB8UI, InternalFormatInfo::RGBAFormat( 8, 8, 8, 0, 0, GL_RGB_INTEGER, GL_UNSIGNED_BYTE, NeverSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGB16I, InternalFormatInfo::RGBAFormat(16, 16, 16, 0, 0, GL_RGB_INTEGER, GL_SHORT, NeverSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGB16UI, InternalFormatInfo::RGBAFormat(16, 16, 16, 0, 0, GL_RGB_INTEGER, GL_UNSIGNED_SHORT, NeverSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGB32I, InternalFormatInfo::RGBAFormat(32, 32, 32, 0, 0, GL_RGB_INTEGER, GL_INT, NeverSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGB32UI, InternalFormatInfo::RGBAFormat(32, 32, 32, 0, 0, GL_RGB_INTEGER, GL_UNSIGNED_INT, NeverSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGBA8I, InternalFormatInfo::RGBAFormat( 8, 8, 8, 8, 0, GL_RGBA_INTEGER, GL_BYTE, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGBA8UI, InternalFormatInfo::RGBAFormat( 8, 8, 8, 8, 0, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGBA16I, InternalFormatInfo::RGBAFormat(16, 16, 16, 16, 0, GL_RGBA_INTEGER, GL_SHORT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGBA16UI, InternalFormatInfo::RGBAFormat(16, 16, 16, 16, 0, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGBA32I, InternalFormatInfo::RGBAFormat(32, 32, 32, 32, 0, GL_RGBA_INTEGER, GL_INT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_RGBA32UI, InternalFormatInfo::RGBAFormat(32, 32, 32, 32, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, AlwaysSupported, NeverSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_BGRA8_EXT, InternalFormatInfo::RGBAFormat( 8, 8, 8, 8, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, AlwaysSupported, AlwaysSupported, AlwaysSupported )));
map.insert(InternalFormatInfoPair(GL_BGRA4_ANGLEX, InternalFormatInfo::RGBAFormat( 4, 4, 4, 4, 0, GL_BGRA_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, AlwaysSupported, AlwaysSupported, AlwaysSupported )));
......
......@@ -55,7 +55,7 @@ static D3D11ES3FormatMap buildD3D11ES3FormatMap()
map.insert(D3D11ES3FormatPair(GL_RGBA8, D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA8_SNORM, D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB10_A2, D3D11ES3FormatInfo(DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB10_A2UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB10_A2UI, D3D11ES3FormatInfo(DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_SRGB8, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_SRGB8_ALPHA8, D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R16F, D3D11ES3FormatInfo(DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_UNKNOWN)));
......@@ -68,30 +68,30 @@ static D3D11ES3FormatMap buildD3D11ES3FormatMap()
map.insert(D3D11ES3FormatPair(GL_RGBA32F, D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R11F_G11F_B10F, D3D11ES3FormatInfo(DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB9_E5, D3D11ES3FormatInfo(DXGI_FORMAT_R9G9B9E5_SHAREDEXP, DXGI_FORMAT_R9G9B9E5_SHAREDEXP, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R8I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R8UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R16I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R16UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R32I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R32UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG8I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG8UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG16I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG16UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG32I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG32UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB8I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB8UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB16I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB16UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB32I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB32UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA8I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA8UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA16I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA16UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA32I, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA32UI, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R8I, D3D11ES3FormatInfo(DXGI_FORMAT_R8_SINT, DXGI_FORMAT_R8_SINT, DXGI_FORMAT_R8_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R8UI, D3D11ES3FormatInfo(DXGI_FORMAT_R8_UINT, DXGI_FORMAT_R8_UINT, DXGI_FORMAT_R8_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R16I, D3D11ES3FormatInfo(DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R16UI, D3D11ES3FormatInfo(DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R32I, D3D11ES3FormatInfo(DXGI_FORMAT_R32_SINT, DXGI_FORMAT_R32_SINT, DXGI_FORMAT_R32_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_R32UI, D3D11ES3FormatInfo(DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG8I, D3D11ES3FormatInfo(DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG8UI, D3D11ES3FormatInfo(DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG16I, D3D11ES3FormatInfo(DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG16UI, D3D11ES3FormatInfo(DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG32I, D3D11ES3FormatInfo(DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RG32UI, D3D11ES3FormatInfo(DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB8I, D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB8UI, D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB16I, D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB16UI, D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB32I, D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32_SINT, DXGI_FORMAT_R32G32B32_SINT, DXGI_FORMAT_R32G32B32_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGB32UI, D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32_UINT, DXGI_FORMAT_R32G32B32_UINT, DXGI_FORMAT_R32G32B32_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA8I, D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA8UI, D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA16I, D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA16UI, D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA32I, D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_UNKNOWN)));
map.insert(D3D11ES3FormatPair(GL_RGBA32UI, D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_UNKNOWN)));
// Unsized formats, TODO: Are types of float and half float allowed for the unsized types? Would it change the DXGI format?
map.insert(D3D11ES3FormatPair(GL_ALPHA, D3D11ES3FormatInfo(DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
......@@ -209,13 +209,13 @@ D3D11LoadFunctionMap buildD3D11LoadFunctionMap()
insertLoadFunction(&map, GL_RGBA16F, GL_HALF_FLOAT, loadToNative<GLhalf, 4> );
insertLoadFunction(&map, GL_RGBA32F, GL_FLOAT, loadToNative<GLfloat, 4> );
insertLoadFunction(&map, GL_RGBA16F, GL_FLOAT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGBA8UI, GL_UNSIGNED_BYTE, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGBA8I, GL_BYTE, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGBA16UI, GL_UNSIGNED_SHORT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGBA16I, GL_SHORT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGBA32UI, GL_UNSIGNED_INT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGBA32I, GL_INT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGB10_A2UI, GL_UNSIGNED_INT_2_10_10_10_REV, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGBA8UI, GL_UNSIGNED_BYTE, loadToNative<GLubyte, 4> );
insertLoadFunction(&map, GL_RGBA8I, GL_BYTE, loadToNative<GLbyte, 4> );
insertLoadFunction(&map, GL_RGBA16UI, GL_UNSIGNED_SHORT, loadToNative<GLushort, 4> );
insertLoadFunction(&map, GL_RGBA16I, GL_SHORT, loadToNative<GLshort, 4> );
insertLoadFunction(&map, GL_RGBA32UI, GL_UNSIGNED_INT, loadToNative<GLuint, 4> );
insertLoadFunction(&map, GL_RGBA32I, GL_INT, loadToNative<GLint, 4> );
insertLoadFunction(&map, GL_RGB10_A2UI, GL_UNSIGNED_INT_2_10_10_10_REV, loadToNative<GLuint, 1> );
insertLoadFunction(&map, GL_RGB8, GL_UNSIGNED_BYTE, loadRGBUByteDataToRGBA );
insertLoadFunction(&map, GL_RGB565, GL_UNSIGNED_BYTE, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_SRGB8, GL_UNSIGNED_BYTE, UnimplementedLoadFunction );
......@@ -230,34 +230,34 @@ D3D11LoadFunctionMap buildD3D11LoadFunctionMap()
insertLoadFunction(&map, GL_RGB16F, GL_FLOAT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_R11F_G11F_B10F, GL_FLOAT, loadRGBFloatDataTo111110Float );
insertLoadFunction(&map, GL_RGB9_E5, GL_FLOAT, loadRGBFloatDataTo999E5 );
insertLoadFunction(&map, GL_RGB8UI, GL_UNSIGNED_BYTE, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGB8I, GL_BYTE, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGB16UI, GL_UNSIGNED_SHORT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGB16I, GL_SHORT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGB32UI, GL_UNSIGNED_INT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGB32I, GL_INT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RGB8UI, GL_UNSIGNED_BYTE, loadToNative3To4<GLubyte, 0x0> );
insertLoadFunction(&map, GL_RGB8I, GL_BYTE, loadToNative3To4<GLbyte, 0x0> );
insertLoadFunction(&map, GL_RGB16UI, GL_UNSIGNED_SHORT, loadToNative3To4<GLushort, 0x0> );
insertLoadFunction(&map, GL_RGB16I, GL_SHORT, loadToNative3To4<GLshort, 0x0> );
insertLoadFunction(&map, GL_RGB32UI, GL_UNSIGNED_INT, loadToNative<GLuint, 3> );
insertLoadFunction(&map, GL_RGB32I, GL_INT, loadToNative<GLint, 3> );
insertLoadFunction(&map, GL_RG8, GL_UNSIGNED_BYTE, loadToNative<GLubyte, 2> );
insertLoadFunction(&map, GL_RG8_SNORM, GL_BYTE, loadToNative<GLbyte, 2> );
insertLoadFunction(&map, GL_RG16F, GL_HALF_FLOAT, loadToNative<GLhalf, 2> );
insertLoadFunction(&map, GL_RG32F, GL_FLOAT, loadToNative<GLfloat, 2> );
insertLoadFunction(&map, GL_RG16F, GL_FLOAT, loadFloatDataToHalfFloat<2> );
insertLoadFunction(&map, GL_RG8UI, GL_UNSIGNED_BYTE, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RG8I, GL_BYTE, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RG16UI, GL_UNSIGNED_SHORT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RG16I, GL_SHORT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RG32UI, GL_UNSIGNED_INT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RG32I, GL_INT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_RG8UI, GL_UNSIGNED_BYTE, loadToNative<GLubyte, 2> );
insertLoadFunction(&map, GL_RG8I, GL_BYTE, loadToNative<GLbyte, 2> );
insertLoadFunction(&map, GL_RG16UI, GL_UNSIGNED_SHORT, loadToNative<GLushort, 2> );
insertLoadFunction(&map, GL_RG16I, GL_SHORT, loadToNative<GLshort, 2> );
insertLoadFunction(&map, GL_RG32UI, GL_UNSIGNED_INT, loadToNative<GLuint, 2> );
insertLoadFunction(&map, GL_RG32I, GL_INT, loadToNative<GLint, 2> );
insertLoadFunction(&map, GL_R8, GL_UNSIGNED_BYTE, loadToNative<GLubyte, 1> );
insertLoadFunction(&map, GL_R8_SNORM, GL_BYTE, loadToNative<GLbyte, 1> );
insertLoadFunction(&map, GL_R16F, GL_HALF_FLOAT, loadToNative<GLhalf, 1> );
insertLoadFunction(&map, GL_R32F, GL_FLOAT, loadToNative<GLfloat, 1> );
insertLoadFunction(&map, GL_R16F, GL_FLOAT, loadFloatDataToHalfFloat<1> );
insertLoadFunction(&map, GL_R8UI, GL_UNSIGNED_BYTE, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_R8I, GL_BYTE, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_R16UI, GL_UNSIGNED_SHORT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_R16I, GL_SHORT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_R32UI, GL_UNSIGNED_INT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_R32I, GL_INT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_R8UI, GL_UNSIGNED_BYTE, loadToNative<GLubyte, 1> );
insertLoadFunction(&map, GL_R8I, GL_BYTE, loadToNative<GLbyte, 1> );
insertLoadFunction(&map, GL_R16UI, GL_UNSIGNED_SHORT, loadToNative<GLushort, 1> );
insertLoadFunction(&map, GL_R16I, GL_SHORT, loadToNative<GLshort, 1> );
insertLoadFunction(&map, GL_R32UI, GL_UNSIGNED_INT, loadToNative<GLuint, 1> );
insertLoadFunction(&map, GL_R32I, GL_INT, loadToNative<GLint, 1> );
insertLoadFunction(&map, GL_DEPTH_COMPONENT16, GL_UNSIGNED_SHORT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_DEPTH_COMPONENT24, GL_UNSIGNED_INT, UnimplementedLoadFunction );
insertLoadFunction(&map, GL_DEPTH_COMPONENT16, GL_UNSIGNED_INT, UnimplementedLoadFunction );
......@@ -459,7 +459,30 @@ static DXGIFormatInfoMap buildDXGIFormatInfoMap()
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R8G8_SNORM, DXGIFormatInfo( 16, 1, 1, GL_RG8_SNORM, GenerateMip<R8G8S> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R8G8B8A8_SNORM, DXGIFormatInfo( 32, 1, 1, GL_RGBA8_SNORM, GenerateMip<R8G8B8A8S> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R8_UINT, DXGIFormatInfo( 8, 1, 1, GL_R8UI, GenerateMip<R8> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R16_UINT, DXGIFormatInfo( 16, 1, 1, GL_R16UI, GenerateMip<R16> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R32_UINT, DXGIFormatInfo( 32, 1, 1, GL_R32UI, GenerateMip<R32> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R8G8_UINT, DXGIFormatInfo( 16, 1, 1, GL_RG8UI, GenerateMip<R8G8> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R16G16_UINT, DXGIFormatInfo( 32, 1, 1, GL_RG16UI, GenerateMip<R16G16> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R32G32_UINT, DXGIFormatInfo( 64, 1, 1, GL_RG32UI, GenerateMip<R32G32> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R32G32B32_UINT, DXGIFormatInfo( 96, 1, 1, GL_RGB32UI, GenerateMip<R32G32B32> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R8G8B8A8_UINT, DXGIFormatInfo( 32, 1, 1, GL_RGBA8UI, GenerateMip<R8G8B8A8> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R16G16B16A16_UINT, DXGIFormatInfo( 64, 1, 1, GL_RGBA16UI, GenerateMip<R16G16B16A16> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R32G32B32A32_UINT, DXGIFormatInfo(128, 1, 1, GL_RGBA32UI, GenerateMip<R32G32B32A32> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R8_SINT, DXGIFormatInfo( 8, 1, 1, GL_R8I, GenerateMip<R8S> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R16_SINT, DXGIFormatInfo( 16, 1, 1, GL_R16I, GenerateMip<R16S> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R32_SINT, DXGIFormatInfo( 32, 1, 1, GL_R32I, GenerateMip<R32S> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R8G8_SINT, DXGIFormatInfo( 16, 1, 1, GL_RG8I, GenerateMip<R8G8S> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R16G16_SINT, DXGIFormatInfo( 32, 1, 1, GL_RG16I, GenerateMip<R16G16S> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R32G32_SINT, DXGIFormatInfo( 64, 1, 1, GL_RG32I, GenerateMip<R32G32S> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R32G32B32_SINT, DXGIFormatInfo( 96, 1, 1, GL_RGB32I, GenerateMip<R32G32B32S> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R8G8B8A8_SINT, DXGIFormatInfo( 32, 1, 1, GL_RGBA8I, GenerateMip<R8G8B8A8S> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R16G16B16A16_SINT, DXGIFormatInfo( 64, 1, 1, GL_RGBA16I, GenerateMip<R16G16B16A16S>)));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R32G32B32A32_SINT, DXGIFormatInfo(128, 1, 1, GL_RGBA32I, GenerateMip<R32G32B32A32S>)));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R10G10B10A2_UNORM, DXGIFormatInfo( 32, 1, 1, GL_RGB10_A2, GenerateMip<R10G10B10A2> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R10G10B10A2_UINT, DXGIFormatInfo( 32, 1, 1, GL_RGB10_A2UI, GenerateMip<R10G10B10A2> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R16_FLOAT, DXGIFormatInfo( 16, 1, 1, GL_R16F, GenerateMip<R16F> )));
map.insert(DXGIFormatInfoPair(DXGI_FORMAT_R16G16_FLOAT, DXGIFormatInfo( 32, 1, 1, GL_RG16F, GenerateMip<R16G16F> )));
......
......@@ -56,6 +56,96 @@ struct A8R8G8B8
typedef A8R8G8B8 R8G8B8A8; // R8G8B8A8 type is functionally equivalent for mip purposes
typedef A8R8G8B8 B8G8R8A8; // B8G8R8A8 type is functionally equivalent for mip purposes
struct R16
{
unsigned short R;
static void average(R16 *dst, const R16 *src1, const R16 *src2)
{
dst->R = ((src1->R ^ src2->R) >> 1) + (src1->R & src2->R);
}
};
struct R16G16
{
unsigned short R;
unsigned short G;
static void average(R16G16 *dst, const R16G16 *src1, const R16G16 *src2)
{
dst->R = ((src1->R ^ src2->R) >> 1) + (src1->R & src2->R);
dst->G = ((src1->G ^ src2->G) >> 1) + (src1->G & src2->G);
}
};
struct R16G16B16A16
{
unsigned short R;
unsigned short G;
unsigned short B;
unsigned short A;
static void average(R16G16B16A16 *dst, const R16G16B16A16 *src1, const R16G16B16A16 *src2)
{
dst->R = ((src1->R ^ src2->R) >> 1) + (src1->R & src2->R);
dst->G = ((src1->G ^ src2->G) >> 1) + (src1->G & src2->G);
dst->B = ((src1->B ^ src2->B) >> 1) + (src1->B & src2->B);
dst->A = ((src1->A ^ src2->A) >> 1) + (src1->A & src2->A);
}
};
struct R32
{
unsigned int R;
static void average(R32 *dst, const R32 *src1, const R32 *src2)
{
dst->R = ((src1->R ^ src2->R) >> 1) + (src1->R & src2->R);
}
};
struct R32G32
{
unsigned int R;
unsigned int G;
static void average(R32G32 *dst, const R32G32 *src1, const R32G32 *src2)
{
dst->R = ((src1->R ^ src2->R) >> 1) + (src1->R & src2->R);
dst->G = ((src1->G ^ src2->G) >> 1) + (src1->G & src2->G);
}
};
struct R32G32B32
{
unsigned int R;
unsigned int G;
unsigned int B;
static void average(R32G32B32 *dst, const R32G32B32 *src1, const R32G32B32 *src2)
{
dst->R = ((src1->R ^ src2->R) >> 1) + (src1->R & src2->R);
dst->G = ((src1->G ^ src2->G) >> 1) + (src1->G & src2->G);
dst->B = ((src1->B ^ src2->B) >> 1) + (src1->B & src2->B);
}
};
struct R32G32B32A32
{
unsigned int R;
unsigned int G;
unsigned int B;
unsigned int A;
static void average(R32G32B32A32 *dst, const R32G32B32A32 *src1, const R32G32B32A32 *src2)
{
dst->R = ((src1->R ^ src2->R) >> 1) + (src1->R & src2->R);
dst->G = ((src1->G ^ src2->G) >> 1) + (src1->G & src2->G);
dst->B = ((src1->B ^ src2->B) >> 1) + (src1->B & src2->B);
dst->A = ((src1->A ^ src2->A) >> 1) + (src1->A & src2->A);
}
};
struct R8S
{
char R;
......@@ -94,6 +184,96 @@ struct R8G8B8A8S
}
};
struct R16S
{
unsigned short R;
static void average(R16S *dst, const R16S *src1, const R16S *src2)
{
dst->R = ((int)src1->R + (int)src2->R) / 2;
}
};
struct R16G16S
{
unsigned short R;
unsigned short G;
static void average(R16G16S *dst, const R16G16S *src1, const R16G16S *src2)
{
dst->R = ((int)src1->R + (int)src2->R) / 2;
dst->G = ((int)src1->G + (int)src2->G) / 2;
}
};
struct R16G16B16A16S
{
unsigned short R;
unsigned short G;
unsigned short B;
unsigned short A;
static void average(R16G16B16A16S *dst, const R16G16B16A16S *src1, const R16G16B16A16S *src2)
{
dst->R = ((int)src1->R + (int)src2->R) / 2;
dst->G = ((int)src1->G + (int)src2->G) / 2;
dst->B = ((int)src1->B + (int)src2->B) / 2;
dst->A = ((int)src1->A + (int)src2->A) / 2;
}
};
struct R32S
{
unsigned int R;
static void average(R32S *dst, const R32S *src1, const R32S *src2)
{
dst->R = ((long long)src1->R + (long long)src2->R) / 2;
}
};
struct R32G32S
{
unsigned int R;
unsigned int G;
static void average(R32G32S *dst, const R32G32S *src1, const R32G32S *src2)
{
dst->R = ((long long)src1->R + (long long)src2->R) / 2;
dst->G = ((long long)src1->G + (long long)src2->G) / 2;
}
};
struct R32G32B32S
{
unsigned int R;
unsigned int G;
unsigned int B;
static void average(R32G32B32S *dst, const R32G32B32S *src1, const R32G32B32S *src2)
{
dst->R = ((long long)src1->R + (long long)src2->R) / 2;
dst->G = ((long long)src1->G + (long long)src2->G) / 2;
dst->B = ((long long)src1->B + (long long)src2->B) / 2;
}
};
struct R32G32B32A32S
{
unsigned int R;
unsigned int G;
unsigned int B;
unsigned int A;
static void average(R32G32B32A32S *dst, const R32G32B32A32S *src1, const R32G32B32A32S *src2)
{
dst->R = ((long long)src1->R + (long long)src2->R) / 2;
dst->G = ((long long)src1->G + (long long)src2->G) / 2;
dst->B = ((long long)src1->B + (long long)src2->B) / 2;
dst->A = ((long long)src1->A + (long long)src2->A) / 2;
}
};
struct A16B16G16R16F
{
unsigned short R;
......
......@@ -216,6 +216,35 @@ void loadToNative(int width, int height, int depth,
}
}
template <typename type, unsigned int fourthComponentBits>
void loadToNative3To4(int width, int height, int depth,
const void *input, unsigned int inputRowPitch, unsigned int inputDepthPitch,
void *output, unsigned int outputRowPitch, unsigned int outputDepthPitch)
{
const type *source = NULL;
type *dest = NULL;
const unsigned int fourthBits = fourthComponentBits;
const type fourthValue = *reinterpret_cast<const type*>(&fourthBits);
for (int z = 0; z < depth; z++)
{
for (int y = 0; y < height; y++)
{
source = offsetDataPointer<type>(input, y, z, inputRowPitch, inputDepthPitch);
dest = offsetDataPointer<type>(output, y, z, outputRowPitch, outputDepthPitch);
for (int x = 0; x < width; x++)
{
dest[x * 4 + 0] = source[x * 3 + 0];
dest[x * 4 + 1] = source[x * 3 + 1];
dest[x * 4 + 2] = source[x * 3 + 2];
dest[x * 4 + 3] = fourthValue;
}
}
}
}
template <unsigned int componentCount>
void loadFloatDataToHalfFloat(int width, int height, int depth,
const void *input, unsigned int inputRowPitch, unsigned int inputDepthPitch,
......
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