[WINESYNC]d3dx9_36: Align texture dimensions to block size for compressed textures in D3DXCheckTextureRequirements.

wine-staging patch by Christian Costa <titan.costa@gmail.com>
This commit is contained in:
winesync 2020-01-04 02:11:30 +01:00 committed by Jérôme Gardou
parent afac88c50e
commit 81c78a0a6b
3 changed files with 54 additions and 4 deletions

View file

@ -335,10 +335,10 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN
if (fmt->block_width != 1 || fmt->block_height != 1)
{
if (w < fmt->block_width)
w = fmt->block_width;
if (h < fmt->block_height)
h = fmt->block_height;
if (w % fmt->block_width)
w += fmt->block_width - w % fmt->block_width;
if (h % fmt->block_height)
h += fmt->block_height - h % fmt->block_height;
}
if ((caps.TextureCaps & D3DPTEXTURECAPS_POW2) && (!is_pow2(w)))