HiresTextures: Support loading BC7 (BPTC) from DDS files

This commit is contained in:
Stenzek
2017-07-27 22:00:04 +10:00
parent d18988f41e
commit 63305e9173
15 changed files with 44 additions and 2 deletions

View File

@ -239,6 +239,16 @@ static bool SupportsS3TCTextures(ID3D11Device* dev)
return ((bc1_support & bc2_support & bc3_support) & D3D11_FORMAT_SUPPORT_TEXTURE2D) != 0;
}
static bool SupportsBPTCTextures(ID3D11Device* dev)
{
// Currently, we only care about BC7. This could be extended to BC6H in the future.
UINT bc7_support;
if (FAILED(dev->CheckFormatSupport(DXGI_FORMAT_BC7_UNORM, &bc7_support)))
return false;
return (bc7_support & D3D11_FORMAT_SUPPORT_TEXTURE2D) != 0;
}
HRESULT Create(HWND wnd)
{
hWnd = wnd;
@ -420,6 +430,7 @@ HRESULT Create(HWND wnd)
device->CheckFormatSupport(DXGI_FORMAT_B8G8R8A8_UNORM, &format_support);
bgra_textures_supported = (format_support & D3D11_FORMAT_SUPPORT_TEXTURE2D) != 0;
g_Config.backend_info.bSupportsST3CTextures = SupportsS3TCTextures(device);
g_Config.backend_info.bSupportsBPTCTextures = SupportsBPTCTextures(device);
stateman = new StateManager;
return S_OK;