mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 19:50:13 +02:00
Fix handling of SRGB_IN and SRGB_OUT for GPU BC7 compressor (#326)
This commit is contained in:
parent
0f77045482
commit
b4719fa58c
@ -154,9 +154,14 @@ namespace
|
|||||||
|
|
||||||
assert(srcImage.pixels && destImage.pixels);
|
assert(srcImage.pixels && destImage.pixels);
|
||||||
|
|
||||||
const DXGI_FORMAT format = gpubc->GetSourceFormat();
|
DXGI_FORMAT tformat = gpubc->GetSourceFormat();
|
||||||
|
if (compress & TEX_COMPRESS_SRGB_OUT)
|
||||||
|
{
|
||||||
|
tformat = MakeSRGB(tformat);
|
||||||
|
}
|
||||||
|
const DXGI_FORMAT sformat = (compress & TEX_COMPRESS_SRGB_IN) ? MakeSRGB(srcImage.format) : srcImage.format;
|
||||||
|
|
||||||
if (srcImage.format == format)
|
if (sformat == tformat)
|
||||||
{
|
{
|
||||||
// Input is already in our required source format
|
// Input is already in our required source format
|
||||||
return gpubc->Compress(srcImage, destImage);
|
return gpubc->Compress(srcImage, destImage);
|
||||||
@ -169,7 +174,7 @@ namespace
|
|||||||
|
|
||||||
auto const srgb = GetSRGBFlags(compress);
|
auto const srgb = GetSRGBFlags(compress);
|
||||||
|
|
||||||
switch (format)
|
switch (tformat)
|
||||||
{
|
{
|
||||||
case DXGI_FORMAT_R8G8B8A8_UNORM:
|
case DXGI_FORMAT_R8G8B8A8_UNORM:
|
||||||
hr = ConvertToRGBA32(srcImage, image, false, srgb);
|
hr = ConvertToRGBA32(srcImage, image, false, srgb);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user