Matteo Bruni : d3dx9: Improve the scoring for fallback formats.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Nov 11 11:04:45 CST 2014


Module: wine
Branch: master
Commit: beb72c91af85e09ef63c933b7fbfd876c51fc238
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=beb72c91af85e09ef63c933b7fbfd876c51fc238

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Mon Nov 10 18:56:14 2014 +0100

d3dx9: Improve the scoring for fallback formats.

---

 dlls/d3dx9_36/texture.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index e997aa2..de42307 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -302,12 +302,13 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN
 
             /* This format can be used, let's evaluate it.
                Weights chosen quite arbitrarily... */
-            score = 16 - 4 * (curchannels - channels);
+            score = 512 * (curfmt->type == fmt->type);
+            score -= 32 * (curchannels - channels);
 
             for (j = 0; j < 4; j++)
             {
                 int diff = curfmt->bits[j] - fmt->bits[j];
-                score += 16 - (diff < 0 ? -diff * 4 : diff);
+                score -= (diff < 0 ? -diff * 8 : diff) * (j == 0 ? 1 : 2);
             }
 
             if (score > bestscore)




More information about the wine-cvs mailing list