1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 10:24:12 +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,10 +127,12 @@ namespace dxvk {
// Use the maximum possible mip level count if the supplied
// mip level count is either unspecified (0) or invalid
const uint32_t maxMipLevelCount =
(pDesc->MultiSample <= D3DMULTISAMPLE_NONMASKABLE && !(pDesc->Usage & D3DUSAGE_AUTOGENMIPMAP))
const uint32_t maxMipLevelCount = pDesc->MultiSample <= D3DMULTISAMPLE_NONMASKABLE
? util::computeMipLevelCount({ pDesc->Width, pDesc->Height, pDesc->Depth })
: 1u;
if (pDesc->Usage & D3DUSAGE_AUTOGENMIPMAP)
pDesc->MipLevels = 0;
if (pDesc->MipLevels == 0 || pDesc->MipLevels > maxMipLevelCount)
pDesc->MipLevels = maxMipLevelCount;