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

@@ -426,9 +426,6 @@ namespace bgfx
BX_TRACE("Num simultaneous render targets: %d", m_caps.NumSimultaneousRTs);
g_caps.supported |= ( 0
| BGFX_CAPS_TEXTURE_FORMAT_BC1
| BGFX_CAPS_TEXTURE_FORMAT_BC2
| BGFX_CAPS_TEXTURE_FORMAT_BC3
| BGFX_CAPS_TEXTURE_3D
| BGFX_CAPS_TEXTURE_COMPARE_LEQUAL
| BGFX_CAPS_VERTEX_ATTRIB_HALF
@@ -471,13 +468,18 @@ namespace bgfx
s_textureFormat[TextureFormat::BC4].m_fmt = s_extendedFormats[ExtendedFormat::Ati1].m_supported ? D3DFMT_ATI1 : D3DFMT_UNKNOWN;
s_textureFormat[TextureFormat::BC5].m_fmt = s_extendedFormats[ExtendedFormat::Ati2].m_supported ? D3DFMT_ATI2 : D3DFMT_UNKNOWN;
g_caps.supported |= 0
| (D3DFMT_UNKNOWN != s_textureFormat[TextureFormat::BC4].m_fmt ? BGFX_CAPS_TEXTURE_FORMAT_BC4 : 0)
| (D3DFMT_UNKNOWN != s_textureFormat[TextureFormat::BC5].m_fmt ? BGFX_CAPS_TEXTURE_FORMAT_BC5 : 0)
| (s_extendedFormats[ExtendedFormat::Df16].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_D16F : 0)
| (s_extendedFormats[ExtendedFormat::Df24].m_supported ? BGFX_CAPS_TEXTURE_FORMAT_D24F : 0)
;
g_caps.supported |= m_instancing ? BGFX_CAPS_INSTANCING : 0;
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
{
g_caps.formats[ii] = SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
, m_deviceType
, adapterFormat
, 0
, D3DRTYPE_TEXTURE
, s_textureFormat[ii].m_fmt
) ) ? 1 : 0;
}
#endif // BGFX_CONFIG_RENDERER_USE_EXTENSIONS
uint32_t index = 1;