mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-11 23:26:14 +01:00
DirectXTex: Fixed bug with application of ordered dithering in non-WIC codepaths
This commit is contained in:
@@ -2524,7 +2524,7 @@ static const XMVECTORF32 g_ErrorWeight7 = { 7.f/16.f, 7.f/16.f, 7.f/16.f, 7.f/16
|
|||||||
{ \
|
{ \
|
||||||
/* Applied ordered dither */ \
|
/* Applied ordered dither */ \
|
||||||
target = XMVectorAdd( v, ordered[ index & 3 ] ); \
|
target = XMVectorAdd( v, ordered[ index & 3 ] ); \
|
||||||
target = XMVectorRound( v ); \
|
target = XMVectorRound( target ); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
target = XMVectorMin( scalev, target ); \
|
target = XMVectorMin( scalev, target ); \
|
||||||
@@ -2578,7 +2578,7 @@ static const XMVECTORF32 g_ErrorWeight7 = { 7.f/16.f, 7.f/16.f, 7.f/16.f, 7.f/16
|
|||||||
{ \
|
{ \
|
||||||
/* Applied ordered dither */ \
|
/* Applied ordered dither */ \
|
||||||
target = XMVectorAdd( v, ordered[ index & 3 ] ); \
|
target = XMVectorAdd( v, ordered[ index & 3 ] ); \
|
||||||
target = XMVectorRound( v ); \
|
target = XMVectorRound( target ); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
target = XMVectorMin( scalev, target ); \
|
target = XMVectorMin( scalev, target ); \
|
||||||
@@ -2630,7 +2630,7 @@ static const XMVECTORF32 g_ErrorWeight7 = { 7.f/16.f, 7.f/16.f, 7.f/16.f, 7.f/16
|
|||||||
{ \
|
{ \
|
||||||
/* Applied ordered dither */ \
|
/* Applied ordered dither */ \
|
||||||
target = XMVectorAdd( v, ordered[ index & 3 ] ); \
|
target = XMVectorAdd( v, ordered[ index & 3 ] ); \
|
||||||
target = XMVectorRound( v ); \
|
target = XMVectorRound( target ); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
target = XMVectorMin( scalev, target ); \
|
target = XMVectorMin( scalev, target ); \
|
||||||
@@ -2745,7 +2745,7 @@ bool _StoreScanlineDither( LPVOID pDestination, size_t size, DXGI_FORMAT format,
|
|||||||
{
|
{
|
||||||
// Applied ordered dither
|
// Applied ordered dither
|
||||||
target = XMVectorAdd( v, ordered[ index & 3 ] );
|
target = XMVectorAdd( v, ordered[ index & 3 ] );
|
||||||
target = XMVectorRound( v );
|
target = XMVectorRound( target );
|
||||||
}
|
}
|
||||||
|
|
||||||
target = XMVectorAdd( target, Bias );
|
target = XMVectorAdd( target, Bias );
|
||||||
@@ -2823,7 +2823,7 @@ bool _StoreScanlineDither( LPVOID pDestination, size_t size, DXGI_FORMAT format,
|
|||||||
{
|
{
|
||||||
// Applied ordered dither
|
// Applied ordered dither
|
||||||
target = XMVectorAdd( v, ordered[ index & 3 ] );
|
target = XMVectorAdd( v, ordered[ index & 3 ] );
|
||||||
target = XMVectorRound( v );
|
target = XMVectorRound( target );
|
||||||
}
|
}
|
||||||
|
|
||||||
target = XMVectorClamp( target, g_XMZero, Scale2 );
|
target = XMVectorClamp( target, g_XMZero, Scale2 );
|
||||||
@@ -2910,7 +2910,7 @@ bool _StoreScanlineDither( LPVOID pDestination, size_t size, DXGI_FORMAT format,
|
|||||||
{
|
{
|
||||||
// Applied ordered dither
|
// Applied ordered dither
|
||||||
target = XMVectorAdd( v, ordered[ index & 3 ] );
|
target = XMVectorAdd( v, ordered[ index & 3 ] );
|
||||||
target = XMVectorRound( v );
|
target = XMVectorRound( target );
|
||||||
}
|
}
|
||||||
|
|
||||||
target = XMVectorClamp( target, g_XMZero, g_Scale565pc );
|
target = XMVectorClamp( target, g_XMZero, g_Scale565pc );
|
||||||
@@ -2958,7 +2958,7 @@ bool _StoreScanlineDither( LPVOID pDestination, size_t size, DXGI_FORMAT format,
|
|||||||
{
|
{
|
||||||
// Applied ordered dither
|
// Applied ordered dither
|
||||||
target = XMVectorAdd( v, ordered[ index & 3 ] );
|
target = XMVectorAdd( v, ordered[ index & 3 ] );
|
||||||
target = XMVectorRound( v );
|
target = XMVectorRound( target );
|
||||||
}
|
}
|
||||||
|
|
||||||
target = XMVectorClamp( target, g_XMZero, g_Scale5551pc );
|
target = XMVectorClamp( target, g_XMZero, g_Scale5551pc );
|
||||||
@@ -3012,7 +3012,7 @@ bool _StoreScanlineDither( LPVOID pDestination, size_t size, DXGI_FORMAT format,
|
|||||||
{
|
{
|
||||||
// Applied ordered dither
|
// Applied ordered dither
|
||||||
target = XMVectorAdd( v, ordered[ index & 3 ] );
|
target = XMVectorAdd( v, ordered[ index & 3 ] );
|
||||||
target = XMVectorRound( v );
|
target = XMVectorRound( target );
|
||||||
}
|
}
|
||||||
|
|
||||||
target = XMVectorClamp( target, g_XMZero, g_Scale8pc );
|
target = XMVectorClamp( target, g_XMZero, g_Scale8pc );
|
||||||
|
|||||||
Reference in New Issue
Block a user