mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-03 14:50:40 +00:00
d3d12: Fix mipmap data
This commit is contained in:
parent
178d0e0e85
commit
eda3c9084e
1 changed files with 2 additions and 4 deletions
|
@ -334,8 +334,6 @@ ID3D12Resource *uploadSingleTexture(
|
||||||
size_t currentHeight = heightInBlocks, currentWidth = widthInBlocks;
|
size_t currentHeight = heightInBlocks, currentWidth = widthInBlocks;
|
||||||
|
|
||||||
unsigned tmp = texture.GetMipmap();
|
unsigned tmp = texture.GetMipmap();
|
||||||
if (tmp > 1)
|
|
||||||
printf("here");
|
|
||||||
for (unsigned mipLevel = 0; mipLevel < texture.GetMipmap(); mipLevel++)
|
for (unsigned mipLevel = 0; mipLevel < texture.GetMipmap(); mipLevel++)
|
||||||
{
|
{
|
||||||
MipmapLevelInfo currentMipmapLevelInfo = {};
|
MipmapLevelInfo currentMipmapLevelInfo = {};
|
||||||
|
@ -366,7 +364,7 @@ ID3D12Resource *uploadSingleTexture(
|
||||||
dst[(row * currentMipmapLevelInfo.rowPitch / 4) + j] = src[LinearToSwizzleAddress(j, row, 0, log2width, log2height, 0)];
|
dst[(row * currentMipmapLevelInfo.rowPitch / 4) + j] = src[LinearToSwizzleAddress(j, row, 0, log2width, log2height, 0)];
|
||||||
}
|
}
|
||||||
else
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case CELL_GCM_TEXTURE_A4R4G4B4:
|
case CELL_GCM_TEXTURE_A4R4G4B4:
|
||||||
|
@ -404,7 +402,7 @@ ID3D12Resource *uploadSingleTexture(
|
||||||
}
|
}
|
||||||
offsetInDst += currentHeight * currentMipmapLevelInfo.rowPitch;
|
offsetInDst += currentHeight * currentMipmapLevelInfo.rowPitch;
|
||||||
offsetInDst = powerOf2Align(offsetInDst, 256);
|
offsetInDst = powerOf2Align(offsetInDst, 256);
|
||||||
offsetInSrc += currentHeight * currentWidth * blockSizeInByte;
|
offsetInSrc += currentHeight * widthInBlocks * blockSizeInByte;
|
||||||
mipinfos.push_back(currentMipmapLevelInfo);
|
mipinfos.push_back(currentMipmapLevelInfo);
|
||||||
currentHeight /= 2;
|
currentHeight /= 2;
|
||||||
currentWidth /= 2;
|
currentWidth /= 2;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue