From c72e6ccc227fae56e5424d59f27134d69d2fc27a Mon Sep 17 00:00:00 2001 From: walbourn_cp Date: Thu, 13 Feb 2014 11:28:26 -0800 Subject: [PATCH] DirectXTex: Fixed bug with application of ordered dithering in non-WIC codepaths --- DirectXTex/DirectXTexConvert.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DirectXTex/DirectXTexConvert.cpp b/DirectXTex/DirectXTexConvert.cpp index 90b0e38..061c0a6 100644 --- a/DirectXTex/DirectXTexConvert.cpp +++ b/DirectXTex/DirectXTexConvert.cpp @@ -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 */ \ target = XMVectorAdd( v, ordered[ index & 3 ] ); \ - target = XMVectorRound( v ); \ + target = XMVectorRound( 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 */ \ target = XMVectorAdd( v, ordered[ index & 3 ] ); \ - target = XMVectorRound( v ); \ + target = XMVectorRound( 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 */ \ target = XMVectorAdd( v, ordered[ index & 3 ] ); \ - target = XMVectorRound( v ); \ + target = XMVectorRound( target ); \ } \ \ target = XMVectorMin( scalev, target ); \ @@ -2745,7 +2745,7 @@ bool _StoreScanlineDither( LPVOID pDestination, size_t size, DXGI_FORMAT format, { // Applied ordered dither target = XMVectorAdd( v, ordered[ index & 3 ] ); - target = XMVectorRound( v ); + target = XMVectorRound( target ); } target = XMVectorAdd( target, Bias ); @@ -2823,7 +2823,7 @@ bool _StoreScanlineDither( LPVOID pDestination, size_t size, DXGI_FORMAT format, { // Applied ordered dither target = XMVectorAdd( v, ordered[ index & 3 ] ); - target = XMVectorRound( v ); + target = XMVectorRound( target ); } target = XMVectorClamp( target, g_XMZero, Scale2 ); @@ -2910,7 +2910,7 @@ bool _StoreScanlineDither( LPVOID pDestination, size_t size, DXGI_FORMAT format, { // Applied ordered dither target = XMVectorAdd( v, ordered[ index & 3 ] ); - target = XMVectorRound( v ); + target = XMVectorRound( target ); } target = XMVectorClamp( target, g_XMZero, g_Scale565pc ); @@ -2958,7 +2958,7 @@ bool _StoreScanlineDither( LPVOID pDestination, size_t size, DXGI_FORMAT format, { // Applied ordered dither target = XMVectorAdd( v, ordered[ index & 3 ] ); - target = XMVectorRound( v ); + target = XMVectorRound( target ); } target = XMVectorClamp( target, g_XMZero, g_Scale5551pc ); @@ -3012,7 +3012,7 @@ bool _StoreScanlineDither( LPVOID pDestination, size_t size, DXGI_FORMAT format, { // Applied ordered dither target = XMVectorAdd( v, ordered[ index & 3 ] ); - target = XMVectorRound( v ); + target = XMVectorRound( target ); } target = XMVectorClamp( target, g_XMZero, g_Scale8pc );