Added caps info for all texture formats.

This commit is contained in:
Branimir Karadžić
2014-07-27 20:44:02 -07:00
parent 2b2c7857e8
commit 6c8eeec36e
7 changed files with 81 additions and 123 deletions

View File

@@ -331,6 +331,7 @@ namespace bgfx
EXT_blend_color,
EXT_blend_minmax,
EXT_blend_subtract,
EXT_compressed_ETC1_RGB8_sub_texture,
EXT_debug_label,
EXT_debug_marker,
EXT_frag_depth,
@@ -472,6 +473,7 @@ namespace bgfx
{ "EXT_blend_color", BGFX_CONFIG_RENDERER_OPENGL >= 31, true },
{ "EXT_blend_minmax", BGFX_CONFIG_RENDERER_OPENGL >= 14, true },
{ "EXT_blend_subtract", BGFX_CONFIG_RENDERER_OPENGL >= 14, true },
{ "EXT_compressed_ETC1_RGB8_sub_texture", false, true }, // GLES2 extension.
{ "EXT_debug_label", false, true },
{ "EXT_debug_marker", false, true },
{ "EXT_frag_depth", false, true }, // GLES2 extension.
@@ -1099,34 +1101,10 @@ namespace bgfx
}
}
uint64_t supportedTextureFormats = 0
| (s_textureFormat[TextureFormat::BC1 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_BC1 : 0)
| (s_textureFormat[TextureFormat::BC2 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_BC2 : 0)
| (s_textureFormat[TextureFormat::BC3 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_BC3 : 0)
| (s_textureFormat[TextureFormat::BC4 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_BC4 : 0)
| (s_textureFormat[TextureFormat::BC5 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_BC5 : 0)
| (s_textureFormat[TextureFormat::ETC1 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_ETC1 : 0)
| (s_textureFormat[TextureFormat::ETC2 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_ETC2 : 0)
| (s_textureFormat[TextureFormat::ETC2A ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_ETC2A : 0)
| (s_textureFormat[TextureFormat::ETC2A1].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_ETC2A1 : 0)
| (s_textureFormat[TextureFormat::PTC12 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_PTC12 : 0)
| (s_textureFormat[TextureFormat::PTC14 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_PTC14 : 0)
| (s_textureFormat[TextureFormat::PTC14A].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_PTC14A : 0)
| (s_textureFormat[TextureFormat::PTC12A].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_PTC12A : 0)
| (s_textureFormat[TextureFormat::PTC22 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_PTC22 : 0)
| (s_textureFormat[TextureFormat::PTC24 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_PTC24 : 0)
| 0
| (s_textureFormat[TextureFormat::D16 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_D16 : 0)
| (s_textureFormat[TextureFormat::D24 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_D24 : 0)
| (s_textureFormat[TextureFormat::D24S8 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_D24S8 : 0)
| (s_textureFormat[TextureFormat::D32 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_D32 : 0)
| (s_textureFormat[TextureFormat::D16F ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_D16F : 0)
| (s_textureFormat[TextureFormat::D24F ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_D24F : 0)
| (s_textureFormat[TextureFormat::D32F ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_D32F : 0)
| (s_textureFormat[TextureFormat::D0S8 ].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_D0S8 : 0)
;
g_caps.supported |= supportedTextureFormats;
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
{
g_caps.formats[ii] = s_textureFormat[ii].m_supported ? 1 : 0;
}
g_caps.supported |= !!(BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES >= 30) || s_extension[Extension::OES_texture_3D].m_supported
? BGFX_CAPS_TEXTURE_3D