mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-09 22:26:13 +01:00
DirectXTex: Fixed problem with DirectCompute compressor for BC7_UNORM_SRGB
- Also added diagnostic message from texconv when doing DirectCompute compression
This commit is contained in:
@@ -352,12 +352,13 @@ HRESULT GPUCompressBC::Compress( const Image& srcImage, const Image& destImage )
|
||||
}
|
||||
|
||||
//--- Create input texture --------------------------------------------------------
|
||||
// TODO - non-power-of-2 BCs require handling non-multiple of 4 cases
|
||||
|
||||
auto pDevice = m_device.Get();
|
||||
if ( !pDevice )
|
||||
return E_POINTER;
|
||||
|
||||
// We need to avoid the hardware doing additional colorspace conversion
|
||||
DXGI_FORMAT inputFormat = ( m_srcformat == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB ) ? DXGI_FORMAT_R8G8B8A8_UNORM : m_srcformat;
|
||||
|
||||
ScopedObject<ID3D11Texture2D> sourceTex;
|
||||
{
|
||||
D3D11_TEXTURE2D_DESC desc;
|
||||
@@ -366,7 +367,7 @@ HRESULT GPUCompressBC::Compress( const Image& srcImage, const Image& destImage )
|
||||
desc.Height = static_cast<UINT>( srcImage.height );
|
||||
desc.MipLevels = 1;
|
||||
desc.ArraySize = 1;
|
||||
desc.Format = srcImage.format;
|
||||
desc.Format = inputFormat;
|
||||
desc.SampleDesc.Count = 1;
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
|
||||
@@ -388,7 +389,7 @@ HRESULT GPUCompressBC::Compress( const Image& srcImage, const Image& destImage )
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC desc;
|
||||
memset( &desc, 0, sizeof(desc) );
|
||||
desc.Texture2D.MipLevels = 1;
|
||||
desc.Format = m_srcformat;
|
||||
desc.Format = inputFormat;
|
||||
desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
|
||||
|
||||
HRESULT hr = pDevice->CreateShaderResourceView( sourceTex.Get(), &desc, sourceSRV.ReleaseAndGetAddressOf() );
|
||||
|
||||
Reference in New Issue
Block a user