HACK: Avoid swizzling and reuploading ASTC image every frame

This commit is contained in:
Ameer J
2023-08-06 14:49:34 -04:00
parent 913803bf65
commit b18c1fb1bb
5 changed files with 39 additions and 4 deletions

View File

@@ -1021,8 +1021,18 @@ void TextureCache<P>::UploadImageContents(Image& image, StagingBuffer& staging)
const GPUVAddr gpu_addr = image.gpu_addr;
if (True(image.flags & ImageFlagBits::AcceleratedUpload)) {
gpu_memory->ReadBlock(gpu_addr, mapped_span.data(), mapped_span.size_bytes(),
VideoCommon::CacheType::NoTextureCache);
static u64 last_size = 0;
bool has_run = false;
if (last_size == image.unswizzled_size_bytes) {
has_run = true;
}
last_size = image.unswizzled_size_bytes;
if (!has_run) {
LOG_ERROR(Debug, "Called");
gpu_memory->ReadBlock(gpu_addr, mapped_span.data(), mapped_span.size_bytes(),
VideoCommon::CacheType::NoTextureCache);
}
const auto uploads = FullUploadSwizzles(image.info);
runtime.AccelerateImageUpload(image, staging, uploads);
return;