mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-04 04:16:12 +01:00
Added explicit test of CanConvert for all use of IWICFormatConverter
This commit is contained in:
@@ -1111,6 +1111,13 @@ HRESULT DirectX::SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
|
||||
return hr;
|
||||
}
|
||||
|
||||
BOOL canConvert = FALSE;
|
||||
hr = FC->CanConvert( pfGuid, targetGuid, &canConvert );
|
||||
if ( FAILED(hr) || !canConvert )
|
||||
{
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
hr = FC->Initialize( source.Get(), targetGuid, WICBitmapDitherTypeNone, 0, 0, WICBitmapPaletteTypeCustom );
|
||||
if ( FAILED(hr) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user