From beb72c91af85e09ef63c933b7fbfd876c51fc238 Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Mon, 10 Nov 2014 18:56:14 +0100 Subject: [PATCH] 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 e997aa2a67b..de423076d18 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) -- 2.11.4.GIT