Additional cleanup

This commit is contained in:
Henrik Rydgård 2022-07-28 12:41:15 +02:00
parent ae6763766e
commit c031f3085b
4 changed files with 2 additions and 10 deletions

View file

@ -644,8 +644,6 @@ void TextureCacheD3D11::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &
int w = gstate.getTextureWidth(srcLevel);
int h = gstate.getTextureHeight(srcLevel);
ID3D11Texture2D *texture = DxTex(&entry);
gpuStats.numTexturesDecoded++;
// For UpdateSubresource, we can't decode directly into the texture so we allocate a buffer :(
u32 *mapData = nullptr;
@ -656,7 +654,6 @@ void TextureCacheD3D11::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &
double replaceStart = time_now_d();
replaced.Load(srcLevel, mapData, mapRowPitch);
replacementTimeThisFrame_ += time_now_d() - replaceStart;
dstFmt = ToDXGIFormat(replaced.Format(srcLevel));
} else {
GETextureFormat tfmt = (GETextureFormat)entry.format;
GEPaletteFormat clutformat = gstate.getClutPaletteFormat();
@ -725,6 +722,7 @@ void TextureCacheD3D11::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &
}
}
ID3D11Texture2D *texture = DxTex(&entry);
context_->UpdateSubresource(texture, dstLevel, nullptr, mapData, mapRowPitch, 0);
FreeAlignedMemory(mapData);
}

View file

@ -598,7 +598,6 @@ void TextureCacheDX9::LoadTextureLevel(TexCacheEntry &entry, uint8_t *data, int
double replaceStart = time_now_d();
replaced.Load(level, data, stride);
replacementTimeThisFrame_ += time_now_d() - replaceStart;
dstFmt = ToD3D9Format(replaced.Format(level));
} else {
GETextureFormat tfmt = (GETextureFormat)entry.format;
GEPaletteFormat clutformat = gstate.getClutPaletteFormat();

View file

@ -635,9 +635,8 @@ void TextureCacheGLES::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &r
gpuStats.numTexturesDecoded++;
if (replaced.GetSize(srcLevel, w, h)) {
PROFILE_THIS_SCOPE("replacetex");
int bpp = (int)DataFormatSizeInBytes(replaced.Format(srcLevel));
decPitch = w * bpp;
uint8_t *rearrange = (uint8_t *)AllocateAlignedMemory(decPitch * h, 16);
double replaceStart = time_now_d();
@ -647,8 +646,6 @@ void TextureCacheGLES::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &r
dstFmt = replaced.Format(srcLevel);
} else {
PROFILE_THIS_SCOPE("decodetex");
GEPaletteFormat clutformat = gstate.getClutPaletteFormat();
u32 texaddr = gstate.getTextureAddress(srcLevel);
int bufw = GetTextureBufw(srcLevel, texaddr, GETextureFormat(entry.format));
@ -686,7 +683,6 @@ void TextureCacheGLES::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &r
}
}
PROFILE_THIS_SCOPE("loadtex");
render_->TextureImage(entry.textureName, dstLevel, w, h, dstFmt, pixelData, GLRAllocType::ALIGNED);
}

View file

@ -1014,7 +1014,6 @@ void TextureCacheVulkan::LoadTextureLevel(TexCacheEntry &entry, uint8_t *writePt
uint8_t *rearrange = (uint8_t *)AllocateAlignedMemory(w * scaleFactor * h * scaleFactor * 4, 16);
scaler.ScaleAlways((u32 *)rearrange, pixelData, fmt, w, h, scaleFactor);
pixelData = (u32 *)writePtr;
dstFmt = (VkFormat)fmt;
// We always end up at 8888. Other parts assume this.
_assert_(dstFmt == VULKAN_8888_FORMAT);