mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 10:35:43 -05:00
GL: Fixing texture formats for GL and GLES31.
This commit is contained in:
parent
eca80d1214
commit
5185e2f901
2 changed files with 20 additions and 6 deletions
|
@ -1168,12 +1168,7 @@ namespace bgfx
|
|||
{
|
||||
setTextureFormat(TextureFormat::D32, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT);
|
||||
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
|
||||
{
|
||||
setTextureFormat(TextureFormat::R16, GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT);
|
||||
setTextureFormat(TextureFormat::RGBA16, GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT);
|
||||
}
|
||||
else
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES < 30) )
|
||||
{
|
||||
setTextureFormat(TextureFormat::RGBA16F, GL_RGBA, GL_RGBA, GL_HALF_FLOAT);
|
||||
|
||||
|
@ -1185,6 +1180,17 @@ namespace bgfx
|
|||
}
|
||||
}
|
||||
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
|
||||
|| BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
|
||||
{
|
||||
setTextureFormat(TextureFormat::R16, GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT);
|
||||
setTextureFormat(TextureFormat::RG16, GL_RG16UI, GL_RG_INTEGER, GL_UNSIGNED_SHORT);
|
||||
setTextureFormat(TextureFormat::RGBA16, GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT);
|
||||
setTextureFormat(TextureFormat::R32, GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT);
|
||||
setTextureFormat(TextureFormat::RG32, GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT);
|
||||
setTextureFormat(TextureFormat::RGBA32, GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT);
|
||||
}
|
||||
|
||||
if (s_extension[Extension::EXT_texture_format_BGRA8888 ].m_supported
|
||||
|| s_extension[Extension::EXT_bgra ].m_supported
|
||||
|| s_extension[Extension::IMG_texture_format_BGRA8888 ].m_supported
|
||||
|
|
|
@ -143,6 +143,10 @@ typedef uint64_t GLuint64;
|
|||
# define GL_RG16 0x822C
|
||||
#endif // GL_RG16
|
||||
|
||||
#ifndef GL_RG16UI
|
||||
# define GL_RG16UI 0x823A
|
||||
#endif // GL_RG16UI
|
||||
|
||||
#ifndef GL_RG16F
|
||||
# define GL_RG16F 0x822F
|
||||
#endif // GL_RG16F
|
||||
|
@ -183,6 +187,10 @@ typedef uint64_t GLuint64;
|
|||
# define GL_RG 0x8227
|
||||
#endif // GL_RG
|
||||
|
||||
#ifndef GL_RG_INTEGER
|
||||
# define GL_RG_INTEGER 0x8228
|
||||
#endif // GL_RG_INTEGER
|
||||
|
||||
#ifndef GL_GREEN
|
||||
# define GL_GREEN 0x1904
|
||||
#endif // GL_GREEN
|
||||
|
|
Loading…
Reference in a new issue