1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-03 22:24:13 +01:00

[d3d9] Fix AUTOGENMIPMAP not working in some instances

Closes #1642
This commit is contained in:
Joshua Ashton 2020-05-26 12:46:55 +01:00
parent 67b1ee4f9b
commit a35df1c3b1

View File

@ -127,11 +127,13 @@ namespace dxvk {
// Use the maximum possible mip level count if the supplied // Use the maximum possible mip level count if the supplied
// mip level count is either unspecified (0) or invalid // mip level count is either unspecified (0) or invalid
const uint32_t maxMipLevelCount = const uint32_t maxMipLevelCount = pDesc->MultiSample <= D3DMULTISAMPLE_NONMASKABLE
(pDesc->MultiSample <= D3DMULTISAMPLE_NONMASKABLE && !(pDesc->Usage & D3DUSAGE_AUTOGENMIPMAP))
? util::computeMipLevelCount({ pDesc->Width, pDesc->Height, pDesc->Depth }) ? util::computeMipLevelCount({ pDesc->Width, pDesc->Height, pDesc->Depth })
: 1u; : 1u;
if (pDesc->Usage & D3DUSAGE_AUTOGENMIPMAP)
pDesc->MipLevels = 0;
if (pDesc->MipLevels == 0 || pDesc->MipLevels > maxMipLevelCount) if (pDesc->MipLevels == 0 || pDesc->MipLevels > maxMipLevelCount)
pDesc->MipLevels = maxMipLevelCount; pDesc->MipLevels = maxMipLevelCount;