From eda3c9084e2a3656fd71c5a33bca42f44253891c Mon Sep 17 00:00:00 2001 From: vlj Date: Tue, 16 Jun 2015 21:41:27 +0200 Subject: [PATCH] d3d12: Fix mipmap data --- rpcs3/Emu/RSX/D3D12/D3D12Texture.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/RSX/D3D12/D3D12Texture.cpp b/rpcs3/Emu/RSX/D3D12/D3D12Texture.cpp index 4b036bf418..4ace1f5a9f 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12Texture.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12Texture.cpp @@ -334,8 +334,6 @@ ID3D12Resource *uploadSingleTexture( size_t currentHeight = heightInBlocks, currentWidth = widthInBlocks; unsigned tmp = texture.GetMipmap(); - if (tmp > 1) - printf("here"); for (unsigned mipLevel = 0; mipLevel < texture.GetMipmap(); mipLevel++) { MipmapLevelInfo currentMipmapLevelInfo = {}; @@ -366,7 +364,7 @@ ID3D12Resource *uploadSingleTexture( dst[(row * currentMipmapLevelInfo.rowPitch / 4) + j] = src[LinearToSwizzleAddress(j, row, 0, log2width, log2height, 0)]; } else - memcpy((char*)textureData + offsetInDst + row * currentMipmapLevelInfo.rowPitch, (char*)pixels + offsetInSrc + row * currentWidth * blockSizeInByte, currentWidth * blockSizeInByte); + memcpy((char*)textureData + offsetInDst + row * currentMipmapLevelInfo.rowPitch, (char*)pixels + offsetInSrc + row * widthInBlocks * blockSizeInByte, currentWidth * blockSizeInByte); break; } case CELL_GCM_TEXTURE_A4R4G4B4: @@ -404,7 +402,7 @@ ID3D12Resource *uploadSingleTexture( } offsetInDst += currentHeight * currentMipmapLevelInfo.rowPitch; offsetInDst = powerOf2Align(offsetInDst, 256); - offsetInSrc += currentHeight * currentWidth * blockSizeInByte; + offsetInSrc += currentHeight * widthInBlocks * blockSizeInByte; mipinfos.push_back(currentMipmapLevelInfo); currentHeight /= 2; currentWidth /= 2;