Skip to content

Commit

Permalink
D3D11 mipmap stride fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Mar 12, 2023
1 parent 1860a73 commit c32e3f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GPU/D3D11/TextureCacheD3D11.cpp
Expand Up @@ -301,7 +301,7 @@ void TextureCacheD3D11::BuildTexture(TexCacheEntry *const entry) {
if (plan.replaceValid) {
int blockSize = 0;
if (Draw::DataFormatIsBlockCompressed(plan.replaced->Format(), &blockSize)) {
stride = mipWidth * 4; // This stride value doesn't quite make sense to me, but it works.
stride = ((mipWidth + 3) & ~3) * 4; // This stride value doesn't quite make sense to me, but it works.
dataSize = plan.replaced->GetLevelDataSize(i);
} else {
int bpp = (int)Draw::DataFormatSizeInBytes(plan.replaced->Format());
Expand Down

0 comments on commit c32e3f8

Please sign in to comment.