mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Texture Cache: Fix untracking on GPU remap
This commit is contained in:
parent
fe6934593f
commit
9ce43ee677
3 changed files with 10 additions and 7 deletions
|
@ -42,6 +42,7 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
rescaleable = false;
|
rescaleable = false;
|
||||||
|
is_sparse = config.is_sparse != 0;
|
||||||
tile_width_spacing = config.tile_width_spacing;
|
tile_width_spacing = config.tile_width_spacing;
|
||||||
if (config.texture_type != TextureType::Texture2D &&
|
if (config.texture_type != TextureType::Texture2D &&
|
||||||
config.texture_type != TextureType::Texture2DNoMipmap) {
|
config.texture_type != TextureType::Texture2DNoMipmap) {
|
||||||
|
|
|
@ -41,6 +41,7 @@ struct ImageInfo {
|
||||||
bool downscaleable = false;
|
bool downscaleable = false;
|
||||||
bool forced_flushed = false;
|
bool forced_flushed = false;
|
||||||
bool dma_downloaded = false;
|
bool dma_downloaded = false;
|
||||||
|
bool is_sparse = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace VideoCommon
|
} // namespace VideoCommon
|
||||||
|
|
|
@ -600,17 +600,17 @@ void TextureCache<P>::UnmapGPUMemory(size_t as_id, GPUVAddr gpu_addr, size_t siz
|
||||||
[&](ImageId id, Image&) { deleted_images.push_back(id); });
|
[&](ImageId id, Image&) { deleted_images.push_back(id); });
|
||||||
for (const ImageId id : deleted_images) {
|
for (const ImageId id : deleted_images) {
|
||||||
Image& image = slot_images[id];
|
Image& image = slot_images[id];
|
||||||
if (True(image.flags & ImageFlagBits::CpuModified)) {
|
if (False(image.flags & ImageFlagBits::CpuModified)) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
image.flags |= ImageFlagBits::CpuModified;
|
image.flags |= ImageFlagBits::CpuModified;
|
||||||
|
if (True(image.flags & ImageFlagBits::Tracked)) {
|
||||||
|
UntrackImage(image, id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (True(image.flags & ImageFlagBits::Remapped)) {
|
if (True(image.flags & ImageFlagBits::Remapped)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
image.flags |= ImageFlagBits::Remapped;
|
image.flags |= ImageFlagBits::Remapped;
|
||||||
if (True(image.flags & ImageFlagBits::Tracked)) {
|
|
||||||
UntrackImage(image, id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1463,7 +1463,8 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA
|
||||||
const ImageId new_image_id = slot_images.insert(runtime, new_info, gpu_addr, cpu_addr);
|
const ImageId new_image_id = slot_images.insert(runtime, new_info, gpu_addr, cpu_addr);
|
||||||
Image& new_image = slot_images[new_image_id];
|
Image& new_image = slot_images[new_image_id];
|
||||||
|
|
||||||
if (!gpu_memory->IsContinuousRange(new_image.gpu_addr, new_image.guest_size_bytes)) {
|
if (!gpu_memory->IsContinuousRange(new_image.gpu_addr, new_image.guest_size_bytes) &&
|
||||||
|
new_info.is_sparse) {
|
||||||
new_image.flags |= ImageFlagBits::Sparse;
|
new_image.flags |= ImageFlagBits::Sparse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue