GL: Fixed texture formats.

This commit is contained in:
Branimir Karadžić 2016-01-11 14:49:56 -08:00
parent c64be968ec
commit 529fdb01c7
3 changed files with 8 additions and 7 deletions

View File

@ -1413,7 +1413,7 @@ namespace bgfx
{
float rgba[4];
unpack(rgba, &src[xx*srcBpp/8]);
pack(&dst[xx*srcBpp/8], rgba);
pack(&dst[xx*dstBpp/8], rgba);
}
}

View File

@ -260,9 +260,9 @@ namespace bgfx { namespace gl
{ GL_RGBA32I, GL_ZERO, GL_RGBA, GL_INT, false }, // RGBA32I
{ GL_RGBA32UI, GL_ZERO, GL_RGBA, GL_UNSIGNED_INT, false }, // RGBA32U
{ GL_RGBA32F, GL_ZERO, GL_RGBA, GL_FLOAT, false }, // RGBA32F
{ GL_RGB565, GL_ZERO, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, false }, // R5G6B5
{ GL_RGBA4, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, false }, // RGBA4
{ GL_RGB5_A1, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, false }, // RGB5A1
{ GL_RGB565, GL_ZERO, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV, false }, // R5G6B5
{ GL_RGBA4, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV, false }, // RGBA4
{ GL_RGB5_A1, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, false }, // RGB5A1
{ GL_RGB10_A2, GL_ZERO, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, false }, // RGB10A2
{ GL_R11F_G11F_B10F, GL_ZERO, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, false }, // R11G11B10F
{ GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // UnknownDepth
@ -1519,9 +1519,9 @@ namespace bgfx { namespace gl
// internalFormat and format must match:
// https://www.khronos.org/opengles/sdk/docs/man/xhtml/glTexImage2D.xml
setTextureFormat(TextureFormat::RGBA8, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE);
setTextureFormat(TextureFormat::R5G6B5, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5);
setTextureFormat(TextureFormat::RGBA4, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4);
setTextureFormat(TextureFormat::RGB5A1, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1);
setTextureFormat(TextureFormat::R5G6B5, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV);
setTextureFormat(TextureFormat::RGBA4, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV);
setTextureFormat(TextureFormat::RGB5A1, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV);
if (s_extension[Extension::OES_texture_half_float].m_supported
|| s_extension[Extension::OES_texture_float ].m_supported)

View File

@ -132,6 +132,7 @@ namespace bgfx
break;
default:
imageConvert(_dst, format, _src, TextureFormat::RGBA8, _width, _height);
break;
}
}