|
|
|
@ -140,7 +140,7 @@ void TextureCache<P>::RunGarbageCollector() { |
|
|
|
} |
|
|
|
if (must_download) { |
|
|
|
auto map = runtime.DownloadStagingBuffer(image.unswizzled_size_bytes); |
|
|
|
const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); |
|
|
|
const auto copies = FullDownloadCopies(image.info); |
|
|
|
image.DownloadMemory(map, copies); |
|
|
|
runtime.Finish(); |
|
|
|
SwizzleImage(*gpu_memory, image.gpu_addr, image.info, copies, map.mapped_span, swizzle_data_buffer); |
|
|
|
@ -629,7 +629,7 @@ void TextureCache<P>::DownloadMemory(DAddr cpu_addr, size_t size) { |
|
|
|
for (const ImageId image_id : images) { |
|
|
|
Image& image = slot_images[image_id]; |
|
|
|
auto map = runtime.DownloadStagingBuffer(image.unswizzled_size_bytes); |
|
|
|
const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); |
|
|
|
const auto copies = FullDownloadCopies(image.info); |
|
|
|
image.DownloadMemory(map, copies); |
|
|
|
runtime.Finish(); |
|
|
|
SwizzleImage(*gpu_memory, image.gpu_addr, image.info, copies, map.mapped_span, |
|
|
|
@ -893,7 +893,7 @@ void TextureCache<P>::CommitAsyncFlushes() { |
|
|
|
for (const PendingDownload& download_info : download_ids) { |
|
|
|
if (download_info.is_swizzle) { |
|
|
|
Image& image = slot_images[download_info.object_id]; |
|
|
|
const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); |
|
|
|
const auto copies = FullDownloadCopies(image.info); |
|
|
|
image.DownloadMemory(download_map, copies); |
|
|
|
download_map.offset += Common::AlignUp(image.unswizzled_size_bytes, 64); |
|
|
|
} |
|
|
|
@ -926,7 +926,7 @@ void TextureCache<P>::PopAsyncFlushes() { |
|
|
|
auto& download_buffer = download_map[download_info.async_buffer_id]; |
|
|
|
if (download_info.is_swizzle) { |
|
|
|
const ImageBase& image = slot_images[download_info.object_id]; |
|
|
|
const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); |
|
|
|
const auto copies = FullDownloadCopies(image.info); |
|
|
|
download_buffer.offset -= Common::AlignUp(image.unswizzled_size_bytes, 64); |
|
|
|
std::span<u8> download_span = |
|
|
|
download_buffer.mapped_span.subspan(download_buffer.offset); |
|
|
|
@ -964,7 +964,7 @@ void TextureCache<P>::PopAsyncFlushes() { |
|
|
|
continue; |
|
|
|
} |
|
|
|
Image& image = slot_images[download_info.object_id]; |
|
|
|
const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); |
|
|
|
const auto copies = FullDownloadCopies(image.info); |
|
|
|
image.DownloadMemory(download_map, copies); |
|
|
|
download_map.offset += image.unswizzled_size_bytes; |
|
|
|
} |
|
|
|
@ -977,7 +977,7 @@ void TextureCache<P>::PopAsyncFlushes() { |
|
|
|
continue; |
|
|
|
} |
|
|
|
const ImageBase& image = slot_images[download_info.object_id]; |
|
|
|
const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); |
|
|
|
const auto copies = FullDownloadCopies(image.info); |
|
|
|
SwizzleImage(*gpu_memory, image.gpu_addr, image.info, copies, download_span, swizzle_data_buffer); |
|
|
|
download_map.offset += image.unswizzled_size_bytes; |
|
|
|
download_span = download_span.subspan(image.unswizzled_size_bytes); |
|
|
|
@ -1160,7 +1160,7 @@ void TextureCache<P>::UploadImageContents(Image& image, StagingBuffer& staging) |
|
|
|
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, FixSmallVectorADL(uploads), 0, 0); |
|
|
|
runtime.AccelerateImageUpload(image, staging, uploads, 0, 0); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1168,11 +1168,11 @@ void TextureCache<P>::UploadImageContents(Image& image, StagingBuffer& staging) |
|
|
|
*gpu_memory, gpu_addr, image.guest_size_bytes, &swizzle_data_buffer); |
|
|
|
if (True(image.flags & ImageFlagBits::Converted)) { |
|
|
|
unswizzle_data_buffer.resize_destructive(image.unswizzled_size_bytes); |
|
|
|
auto copies = FixSmallVectorADL(UnswizzleImage(*gpu_memory, gpu_addr, image.info, swizzle_data, unswizzle_data_buffer)); |
|
|
|
auto copies = UnswizzleImage(*gpu_memory, gpu_addr, image.info, swizzle_data, unswizzle_data_buffer); |
|
|
|
ConvertImage(unswizzle_data_buffer, image.info, mapped_span, copies); |
|
|
|
image.UploadMemory(staging, copies); |
|
|
|
} else { |
|
|
|
const auto copies = FixSmallVectorADL(UnswizzleImage(*gpu_memory, gpu_addr, image.info, swizzle_data, mapped_span)); |
|
|
|
const auto copies = UnswizzleImage(*gpu_memory, gpu_addr, image.info, swizzle_data, mapped_span); |
|
|
|
image.UploadMemory(staging, copies); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1401,7 +1401,7 @@ void TextureCache<P>::TickAsyncDecode() { |
|
|
|
auto staging = runtime.UploadStagingBuffer(MapSizeBytes(image)); |
|
|
|
std::memcpy(staging.mapped_span.data(), async_decode->decoded_data.data(), |
|
|
|
async_decode->decoded_data.size()); |
|
|
|
image.UploadMemory(staging, FixSmallVectorADL(async_decode->copies)); |
|
|
|
image.UploadMemory(staging, async_decode->copies); |
|
|
|
image.flags &= ~ImageFlagBits::IsDecoding; |
|
|
|
has_uploads = true; |
|
|
|
i = async_decodes.erase(i); |
|
|
|
@ -1469,7 +1469,7 @@ void TextureCache<P>::TickAsyncUnswizzle() { |
|
|
|
|
|
|
|
if (z_count > 0) { |
|
|
|
const auto uploads = FullUploadSwizzles(task.info); |
|
|
|
runtime.AccelerateImageUpload(image, task.staging_buffer, FixSmallVectorADL(uploads), z_start, z_count); |
|
|
|
runtime.AccelerateImageUpload(image, task.staging_buffer, uploads, z_start, z_count); |
|
|
|
task.last_submitted_offset += (static_cast<size_t>(z_count) * task.bytes_per_slice); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1730,9 +1730,9 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA |
|
|
|
const u32 down_shift = can_rescale ? resolution.down_shift : 0; |
|
|
|
auto copies = MakeShrinkImageCopies(new_info, overlap.info, base, up_scale, down_shift); |
|
|
|
if (overlap.info.num_samples != new_image.info.num_samples) { |
|
|
|
runtime.CopyImageMSAA(new_image, overlap, FixSmallVectorADL(copies)); |
|
|
|
runtime.CopyImageMSAA(new_image, overlap, copies); |
|
|
|
} else { |
|
|
|
runtime.CopyImage(new_image, overlap, FixSmallVectorADL(copies)); |
|
|
|
runtime.CopyImage(new_image, overlap, copies); |
|
|
|
} |
|
|
|
new_image.modification_tick = overlap.modification_tick; |
|
|
|
} |
|
|
|
|